Reputation: 399
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.
Upvotes: 4
Views: 2011
Reputation: 3322
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.
Upvotes: 1
Reputation: 117314
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
Upvotes: 8