click on marker

12 views
Skip to first unread message

Md. Imran Hossain

unread,
Jul 3, 2022, 12:33:23 AM7/3/22
to Leaflet
marker.on('click', onMarkerClick );
is firing multiple time .
how to solve it?

Edwin Corrigan

unread,
Jul 3, 2022, 8:09:12 AM7/3/22
to leafl...@googlegroups.com
Hello, 

Not fully sure if the multiple clicks can be avoided, happy to take a look if you provide a codepen.

You can use some debouncing though to ignore the multiple events being triggered within a set timeframe, lodash has a function for that:

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/9d7cb8f8-b3e3-4385-8ffc-13178fbc4687n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages