Leaflet / Leaflet.draw

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

Multiple middle markers creation #534

Open eduoda opened 8 years ago

eduoda commented 8 years ago

When one edit a polyline or a polygon on mobiles, several middle markers are created. It gets clear when you save and edit it again, trying to move the new marker one more time.

The problem seems to be a misuse of touchmove event, which is called several times while dragging the marker and therefore calling the onDragStart listener more than once. I think that we can just remove the listener in the beginning of onDragStart function adding this line: marker.off('touchmove', onDragStart, this);

samucs commented 8 years ago

This seems to fix the problem with my touch device. Thank you!

eduoda commented 8 years ago

you're welcome! you may also like to take a look at #532.