Leaflet / Leaflet.draw

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

Finish drawing process with editable feature #869

Open jacmendt opened 6 years ago

jacmendt commented 6 years ago

How to reproduce

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

I would expect that the drawing process is finished and the newly generated Feature is added to the layer with editing enabled. But in the example attached, after finishing the geometry and adding a new layer with editing enabled, the drawing process is still running.

Minimal example reproducing the issue

Example - https://jsfiddle.net/xpvt214o/268042/

zoubir commented 5 years ago

Dear @jacmendt

I met the similar issue, and as i think the issue is the same like :

804

Edit.Poly.js:140 Uncaught TypeError: Cannot read property 'className' of undefined

I solved it by doing this temporary fix, for the polygon/polyline case :

      newLayer.options.editing = {};
       newLayer.editing.enable();

take a look at : http://jsfiddle.net/Zoubir/53L0j1yh/

hope this will help.

Gilson401 commented 3 months ago

@jacmendt did you solve your problem?