Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fire event after MarkerClusterer has finished

So I have an application that contains a map with (several hundreds) of markers. I use the markerclusterer.js supplied by Google to cluster my markers and make the whole thing easier to look at. I'm using API V3.

I'm fine with all of that. But what I would like to do is perform some action when the markerclusterer has finished clustering all the markers. I've tried to do it myself but with no look.

Any suggestions? (I'm assuming this will be easier than I think and my brain is just fried)

like image 819
gordon Avatar asked Oct 03 '12 15:10

gordon


Video Answer


2 Answers

I was just wondering the same thing. This is how I did it:

google.maps.event.addListener(markerClusterer, 'clusteringend', myFunction);
like image 118
Charlotte Tan Avatar answered Oct 25 '22 14:10

Charlotte Tan


Will the map "idle" event work for you? It should fire once the MarkerClusterer has finished (assuming you are loading the MarkerClusterer when the page loads).

like image 35
geocodezip Avatar answered Oct 25 '22 15:10

geocodezip