2
votes

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.

2
What does your code look like? Or can you provide link to a jsfiddle (or a live map) that exhibits the issue and instructions on how to reproduce it?geocodezip
It's actually a lot of code with multiple layers of polygons but the markers and clustering is pretty standard. I do the standard mc = new MarkerClusterer(map, markers); and add pass it the markers. It works perfectly well except when there are two pointers in the same location. IE two markers with the exact same address. Instead of showing one pointer on top of the other, the cluster icon just disappears once it's clicked on a couple of times.Ayrad
Have you tried the most recent version of MarkerClustererPlus (looks like 2.0.16 at the present time)?geocodezip
unfortunately it's the same issue with 2.0.16Ayrad
I suggest you investigate the differences between your implementation and mine then.geocodezip

2 Answers

2
votes

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.
0
votes

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);
});