Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 629
Crimix Avatar asked Jan 14 '23 03:01

Crimix


1 Answers

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

like image 149
Dr.Molle Avatar answered Mar 08 '23 23:03

Dr.Molle