Open nhinze opened 8 years ago
Neither does draw:editvertex
map.on('draw:editvertex', function (e) {
console.log('draw:editvertex');
});
LL 0.7.7
The events fire fine when adding or removing points along the polyline. It's when dragging a point that it does not work.
I noticed that the events fire correctly when testing on Chrome and using the mobile device touch simulator in the Dev tools. However, the events do not fire on iOS or Android. From some online research, it seems that the touchend event is a bit unreliable. Hopefully a workaround can be found.
I just tested Leaflet-draw 0.4 and I can report the following:
@nhinze Hi, did you ever come to any sort of resolution for this issue? I'm running into some problems with iOS/Android editing and I think its the same problem. I'm about to dig into the code but if you've already found a solution then I'd like to get a PR together and hopefully get it merged into master
.
I found that the event fires for draw:edited
but that the layers array is empty. This makes it difficult to persist changes to a server.
edited flag is not being toggle appropriately on dragend
I never found a fix. I think the problem is at LL level. Touch end does not get fired for some reason.
I have a fix for it; basically just comment out the if (leaflet.edited)
check in the save function for EditToolbar.Edit
. This is appropriate for our project but I'm guessing a deeper fix will be necessary to correct the underlying issue with touchscreens. The fix is present in the master
branch of z0d14c/Leaflet.draw
With Leaflet-draw 0.3.2, the 'edit' event does not fire on iOS simulator with iOS 9.3. It works fine on desktop.
How to reproduce: