Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.97k stars 992 forks source link

removeAllLayers Error #756

Open sgentile opened 7 years ago

sgentile commented 7 years ago

How to reproduce

Draw a shape - click edit, click clearAll

What behaviour I'm expecting and which behaviour I'm seeing

I'm getting a console error: core.es5.js:1020 ERROR TypeError: this._activeMode.handler.removeAllLayers is not a function at NewClass._clearAllLayers (leaflet.draw.js:9) at HTMLAnchorElement.handler (DomEvent.js:72)

Additionally, after clicking edit and modifying and clicking save - the dotted outline shape stays dotted and doesn't return back to solid lines

jbccollins commented 7 years ago

"Additionally, after clicking edit and modifying and clicking save - the dotted outline shape stays dotted and doesn't return back to solid lines"

Are you using Leaflet's canvas renderer or the svg renderer? This happens for me when I use the canvas renderer but if I switch to SVG it works fine. Probably a bug with leaflet not with leaflet-draw

sgentile commented 7 years ago

Thanks - yes, I saw this once we enabled canvas renderer - and it still exists on leaflet 1.2.0.

sgentile commented 7 years ago

I'll create a new item for this