You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am facing an interesting problem with the library.
It only happens with one specific polygon, this polygon has more than 5K points but I have polygons with 6K points that work well.
The problem is, that I am editing the polygon, and when the drag ends it returns a console.log "listener not found" for each point of the polygon and does not fire pm:edit, debugging I saw that the console message was for "dragend" event.
here we have a video showing the problem
Gravacao.de.Tela.2024-07-05.as.09.09.00.mov
Here how we are enabling edition and setting pm:edit listener
map.eachLayer((layer)=>{if(layer.options?.payload?.zoneId&&layer?.options?.payload?.zoneId===zoneId){layer.pm?.enable({allowSelfIntersection: false,
snappable,limitMarkersToCount: 100,limitMarkersToViewport: true,});layer.on('pm:edit',(e)=>{const{ id }=e.layer.options.payload;constpoints=e.layer.getLatLngs()[0];editedLayers.set(id,{ id, points });onEdited(editedLayers);});}});
Your polygon has self-intersection. This is the reason why the vertex jumps back and no pm:edit is fired (because no edit was done). You can disable this with setting the option allowSelfIntersection to true.
Thank you for being so helpful @Falke-Design
I tested in here and allowed self-intersection of the polygon edit normally.
I will understand where the intersection is to remove it.
About the versions I am using
leaflet: 1.8.0
leaflet-geoman-free: 2.14.2
Hi, everyone!
I am facing an interesting problem with the library.
It only happens with one specific polygon, this polygon has more than 5K points but I have polygons with 6K points that work well.
The problem is, that I am editing the polygon, and when the drag ends it returns a console.log "listener not found" for each point of the polygon and does not fire pm:edit, debugging I saw that the console message was for "dragend" event.
here we have a video showing the problem
Gravacao.de.Tela.2024-07-05.as.09.09.00.mov
Here how we are enabling edition and setting pm:edit listener
Polygon
londrina.txt
The text was updated successfully, but these errors were encountered: