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
Use the Layers Control on the right to hide, then show the "Editing layer"
Try dragging any of the editable shapes
Result: They are no longer draggable. The vertices can still be dragged though.
Update: Layers Control uses Map.removeLayer(layer) and Map.addLayer(layer) to toggle things, so I created a slightly more minimal example demonstrating the issue here:
The first one passes (when using layer.disableEdit(); layer.enableEdit();), the second one fails (when using this.map.removeLayer(layer); this.map.addLayer(layer);). Calling layer.disableEdit(); before removing the layer also doesn't seem to help.
The text was updated successfully, but these errors were encountered:
danmichaelo
changed the title
Layers are no longer draggable after being toggled by Layers Control
Layers are no longer draggable after being toggled
Sep 8, 2019
danmichaelo
added a commit
to danmichaelo/Leaflet.Editable
that referenced
this issue
Sep 8, 2019
@danmichaelo You find a work around on this? I have a clear all layers option on the map, and once I've done this I can't enable editing again. I've gotten so that it works if I don't clear canvas layers but separating panes don't matter.
@danmichaelo I stumbled on this problem to. After a map.removeLayer(featureGroup) and a map.addLayer(featureGroup), dragging is no longer working. I can still edit the points of a polyline, but dragging is not working. I suspect the error lies in the Path.Drag.js and not in Leaflet.Editable
It seems like editable layers are no longer draggable after being toggled by Layers Control or by other means.
To demonstrate the issue, I modified (diff) the basic example by adding the editable layers to a LayerGroup that can be toggled using Layers Control:
https://danmichaelo.github.io/Leaflet.Editable/example/
To reproduce the issue:
Result: They are no longer draggable. The vertices can still be dragged though.
Update: Layers Control uses
Map.removeLayer(layer)
andMap.addLayer(layer)
to toggle things, so I created a slightly more minimal example demonstrating the issue here:https://danmichaelo.github.io/Leaflet.Editable/example/minimal.html
Also created two tests:
danmichaelo@36d15b5
The first one passes (when using
layer.disableEdit(); layer.enableEdit();
), the second one fails (when usingthis.map.removeLayer(layer); this.map.addLayer(layer);
). Callinglayer.disableEdit();
before removing the layer also doesn't seem to help.The text was updated successfully, but these errors were encountered: