markercluster not changing after setvisible

Emrulez picture Emrulez · Jan 26, 2012 · Viewed 7.4k times · Source

Currently I have a set of markers and I cluster them like this:

var markerCluster = new MarkerClusterer(map, cm_mapMarkers);

But I also have a set of filters which i use to set markers visible false or true. Unfortunatly when I set the marker setvisible(false) the cluster count is not changing.

So I looked for methods to do this:

I tried the following:

MarkerClusterer.redraw();
MarkerClusterer.repaint();

Both resulting in : has no method 'repaint' has no method 'redraw'

Here is a JSfiddle:

http://jsfiddle.net/tDYcX/30/

Anybody knows what I am doing wrong?

Thanks in advance

Answer

Emrulez picture Emrulez · Jan 30, 2012

I managed to do it using markerclustererplus and using markerCluster.setIgnoreHidden(true); and markerCluster.repaint();