Crimix
Crimix

Reputation: 399

Is there a way to toggle MarkerClustererPlus

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

Answers (2)

jjwdesign
jjwdesign

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.

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

Upvotes: 1

Dr.Molle
Dr.Molle

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

Related Questions