`drag` event listeners get lost when changing marker icon during drag
See original GitHub issueIn 1.0.0-beta.2
one could call setIcon()
(using a L.divIcon()
) on a marker in the drag
listener and the listener gets called on each event. A dragend
listener also gets called. See http://jsbin.com/jegoqocebu/1/edit?html,js,console,output
In 1.0.0-rc.1
with the same code the listener gets called only on the first drag
event (but for each new drag
) and the dragend
listener doesn’t get called at all. See http://jsbin.com/tudezarose/2/edit?html,js,console,output
Is this related to #4458 and expected?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Google Maps drag and dragend event listeners won't work if ...
I am using your code only. I wanted dragend event to get the location stored of the marker in database. I added dragend...
Read more >Drag operations - Web APIs - MDN Web Docs - Mozilla
Starting a drag operation In this example, we add a listener for the dragstart event by using the addEventListener() method. When a user...
Read more >Map | Maplibre gl js - Documentation Portal - MapTiler
The map's BoxZoomHandler, which implements zooming using a drag gesture with the Shift key pressed. Find more details and examples using boxZoom in...
Read more >Draggable Directions | Maps JavaScript API
This example demonstrates the use of the DirectionsService object to fetch directions between draggable markers. Read the documentation.
Read more >https://www.tisa.ch/wp-content/plugins/wp-google-m...
List your map markers in the four ways; basic list, basic table, carousel, ... simply go to Appearance->Widgets and drag the "WP Google...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@FadilEldin because then icon changes on drag end not on drag start.
I had a similar issue and I fixed it by extending DivIcon to handle a
setHTML
method. Changing the innerHTML of the div without recreating the DivIcon solves the issue.Maybe this setHTML method should be added to DivIcon. If you want me to submit a PR, let me know.