Is there a way to switch MarkerClustererPlus

I use MarkerClustererPlus to cluster markers on google map (v3)

Is there a way to switch clustering using a function. Namely, I do not use markers, but only switch the visibility of cluster icons.

To display it, we have the repaint property, but I could not find the property to hide the clusters.

+4
source share
2 answers

set marker map parameter

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

Note: when you set the map to null, all cluster markers will be displayed as markers, I'm not sure if this is the desired behavior.

+6
source

If you just want to hide all the clusters, then Dr. Mollet's answer works fine. If you want to hide only the subgroup / subsection of your map markers, then an update / rebuild is required.

Here is an extended example that can help others find this page through Google Search.

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

+1
source

Source: https://habr.com/ru/post/1486163/


All Articles