Indicate if clustering/unclustering in animationend-event
See original GitHub issueI need to perform different actions when markers are clustered/unclustered. However it seems that the animationend
-event does not provide any information indicating the animation direction with it.
Are there any other approaches suggested or has this use case never occured before? If not, I’d like to propose that either an event-object will be passed to the callback or that two sub-event-types are being introduced - clusterend
and unclusterend
- that are getting fired together with animationend
respectively.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Leaflet and MarkerCluster - don't perform clustering when ...
Currenrly, i'm forced to listen for every "animationend" event (when any change happens to the clusters controlled by MarkerCluster anywhere on ...
Read more >Element: animationend event - Web APIs | MDN
The animationend event is fired when a CSS Animation has completed. If the animation aborts before reaching completion, such as if the ...
Read more >How to determine if a cluster is at its maxZoom level?
Ok, just did a quick test and was able to confirm that the animationend event will do the trick: // markers is the...
Read more >Leaflet.markercluster - Shenchen Liu's website
Provides Beautiful Animated Marker Clustering functionality for Leaflet, ... when creating the L.Polygon(points, options) to show the bounds of a cluster.
Read more >leaflet-cluster · master · MAKB / MapKB · GitLab - USGS.gov
The following methods can be used with clusters (not the group). They are typically used for event handling. Getting the bounds of a...
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
I would like to open/close a popup when the a marker is clustered / unclustered. The popup is not attached to the marker directly… it is just associated with it. I have cached a value
popup_marker
and need to detect whether this marker has just been clustered / unclustered to toggle a popup.I found out the unclustering always calls the
iconCreateFunction
(correct me if I’m wrong). So I added the open popup trigger to that. But I still need a way to detect when the marker gets clustered again. Any suggestions?Yes, I believe I did. You can do something like this:
There is no event I know to detect a marker being clustered directly. However, the
iconCreateFunction
gets called when it creates the meta “clustered” icon; the children of the meta icon are all the markers that were clustered.The
c.is_spiderfied
flag I set manually based on thespiderfied
andunspiderfied
events. If you aren’t using the spiderfy feature, you can remove that part.