Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Markerclusterer end event

I am using markerclusterer for Google Maps in the home page of my project.

I am showing a page loading image till the markerclusterer loads fully (with its complete total of markers)

The below code does not work for me.

google.maps.event.addListener(markerCluster, 'clusterend', function() {
$("#intialimage").hide()
});

In place of 'clusterend', I tried with 'clusteringend', 'click','clusterclick' instead etc., for testing purpose.

I suspect the image is in foreground and does not let the markerclusterer receive the event.

Using a div and CSS class, the image is shown. Unable to get proper syntax for the addlistener of markerclusterer for the cluster end event.

Could anyone suggest on which could have gone wrong or any other suggestion?

like image 976
user3887061 Avatar asked Nov 01 '22 19:11

user3887061


1 Answers

i had the same problem. i change library - @version 2.0.8 [February 9, 2012] https://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/markerclustererplus/src/markerclusterer.js?r=360

and it work:

        var markerCluster2 = new MarkerClusterer(map, markers, mcOptions);
        google.maps.event.addListener(markerCluster2, 'clusteringend', myFunction);
like image 100
Эрих Гайлис Avatar answered Dec 19 '22 23:12

Эрих Гайлис