Question

I use MarkerClustererPlus for clustering markers on google map (v3)

Is there a way to toggle clustering with a function. Namely I dont wont to effect markers, but only toggle visibility of cluster icons.

For showing it we have property - repaint, but I couldnt find the property to hide clusters.

Was it helpful?

Solution

set the map-option of the markerClusterer

clustererObject.setOptions({map:null});//hides the clusterIcons
clustererObject.setOptions({map:mapObject});//restores the clusterIcons

Note: when you set the map to null all clustered markers will appear as markers, I'm not sure if this is the desired behaviour

OTHER TIPS

If you're looking to just hide all clusters, then Dr. Molle's answer works great. If you're looking to hide just a sub-group/sub-section of your maps markers, then a refresh/rebuild will be needed.

Here's an advanced example that may help others finding this page thru Google Search.

http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.1.1/examples/advanced_example.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top