Closed habib-farhan closed 6 years ago
Hi, the problem is that linetouched
is an event generated by Leaflet's event system, it is not a DOM event, and as such also does not have the same methods (like stopPropagation
, preventDefault
, etc.).
Additionally, even if this event was stopped from bubbling, it would not help, since the initial mousedown
event would still bubble.
So, in conclusion, the fix is to make sure the handler for mousedown
stops propagation.
Hi Per,
I am adding waypoint with a click on the map and not with context menu, so when i click on route line to addWaypoints, apparently the map also gets the event and waypoints are added. I tried to do the e.stopPropagation, but I get the error, "its not a funciton". What can i add here to stop event propagation?
_hookEvents: function(l) { l.on('linetouched', function(e) { this._plan.dragNewWaypoint(e); }, this); },
Best, Farhan