perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.06k stars 347 forks source link

waypointsspliced not fired on marker drag #626

Open neogeomat opened 3 years ago

neogeomat commented 3 years ago

When a marker is dragged 'waypointschanged' is fired but 'waypointsspliced' is not fired.

e.g. https://jsfiddle.net/qd5uygwp/. when marker is dragged alert form on 'waypointschanged' appears but not from 'waypointsspliced'.

IncubuzzCC commented 3 years ago

@neogeomat I am looking at the same issue and thanks to your example I realized something interresting: The 'waypointsspliced' event only seems to fire when you grab (drag and drop) a route but not when moving existing waypoints/markers. I wonder if this is the expected behaviour. The difficulty I see with this, is that when 'waypointsspliced' fires, it does so right after 'waypointschanged', which means you would have to let the 'waypointschanged' event pass when a new waypoint is detected to have it captured by 'waypointsspliced' and have 'waypointschanged' handling the changes.