Open mdomnita opened 7 years ago
Drawing a rectangle using a drag motion also has problems.
Nice issue report, the issue also occurs in Edge on Windows 10.
There is also an issue when polygon drawing is enabled and the user drags the map a new vertex is added.
anyone find a fix for this issue?
How to reproduce
In the main example, using a touch enabled browser (Chrome) and a desktop computer, start drawing a polygon. Double clicking on a point does not close the polygon (like it does in Firefox). Instead it zooms in and moves the map giving the user difficulty in continuing the polygon creation. If the mouse is moved by mistake when double clicking, new vertexes are created and the user easily gets to the situation where he has multiple vertices on top of one another and is not able to continue the polygon because of the "Shape edges cannot cross" error.
What behaviour I'm expecting and which behaviour I'm seeing
A new node should not be added unless there is a minimal distance between the last node and the new one (the mouse is out of the square marking the last node). If the user tries to create a new node it should snap to the current one. Double clicking should close the polygon on all browsers on desktop computers.
Minimal example reproducing the issue
The main example on the page causes the same issues like I get with the new versions of Leaflet and Leaflet.draw. http://leaflet.github.io/Leaflet.draw/docs/examples/full.html A video of the behavior can be seen here https://youtu.be/sCnKx9zOD5c
Disabling the touch from Javascript would cause problems on mobile devices and I expect them both to work.
Using jsfiddle or another example site.