Marker setIcon() triggered by dragstart event

118 views
Skip to first unread message

Keith Turkowski

unread,
Jun 18, 2012, 2:38:01 AM6/18/12
to leafl...@googlegroups.com
I'm trying to change a marker icon when I begin dragging it. Currently, it changes the icon, but it stops the drag of the marker, and the icon doesn't move.
________________

marker.addEventListener('dragstart', onDragStart);

onDragStart = function () {
     marker.setIcon(NEW_MARKER_IMAGE);
}
________________

Any suggestions on a workaround for this?

Kevin Whitcomb

unread,
May 10, 2016, 10:07:49 AM5/10/16
to Leaflet
I'm trying to do something similar and noticed the same behavior, namely calling setIcon stops drag events from firing.  Is there any way to keep the events coming?
Reply all
Reply to author
Forward
0 new messages