Question

I am using google maps api v3 as well as marker cluster plus from this url (http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.9/src/markerclusterer_packed.js)

Now my issue is:

I have two pointers that are mapped to the exact same latitude and longitude. Naturally marker clusterer shows a blue bubble with the number 2 on it. However when I click on the blue bubble the after zooming in, the blue cluser icon dissapears and no pointers are shown.

When this happens my zoomChanged even is also triggered and alerts me that the zoom level is 49 before being triggered again and alerting of the correct zoom level of 20.

Was it helpful?

Solution

You need to specify the maxZoom so it displays the markers.

from the documentation

maxZoom | number | The maximum zoom level at which clustering is enabled or null if clustering is to be enabled at all zoom levels. The default value is null.

OTHER TIPS

The accepted answer did not work for me, since our project requires that the marker clusterer is visible at all zoom levels. Using the Marker Clusterer instead of the Marker Clusterer Plus plugin fixes the issue, but was not an option due to other factors. What I ended up doing instead was to manually handle the click event after setting the zoomOnClick option to false:

var clusterer = new MarkerClusterer(map, [], {
  zoomOnClick: false
});

google.maps.event.addListener(clusterer, 'click', function (cluster) {
  map.panTo(cluster.getCenter());
  map.set('zoom', map.get('zoom') + 2);
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top