Yugal Jindle
Yugal Jindle

Reputation: 45716

Google Maps V3 : MarkerClusterer is not collapsing to markers ?? (VERY STRANGE)

I have a lot of markers on my map, so i implemented marker Clusterer ! But, Strangly..

MarkerClusterer collapses to smaller values 244 > 32 > 4 > 2 But after I click 2 -> I should be able to see both the markers, but its collapsing the last 2.

Everything was working fine untill I made the markers to load via ajax !

Upvotes: 1

Views: 2752

Answers (2)

Jonathan Palumbo
Jonathan Palumbo

Reputation: 6871

I was having the same issue, one marker with a label of "2" that would not collapse all the way, I double checked and the marker was NOT being added twice.

I was able to get the desired behavior by increasing the minimumClusterSize to 3. That is the only way I could find to solve the problem, hope it helps someone.

Upvotes: 1

Recep Karabıçak
Recep Karabıçak

Reputation: 2083

Default minimum cluster size for the markerCLusterer is 2. So you should set it to 1 when calling for a new MarkerClusterer;

var CLUSTER_MINIMUM_SIZE = 1;
markerCluster = MarkerClusterer(map, [], { minimumClusterSize: CLUSTER_MINIMUM_SIZE }))

You can find brief explanation for the optional constructor parameters inside the javascript file of the markerclusterer.

Upvotes: 1

Related Questions