我正在像这样在 map 上创建聚类:
markerCluster = new MarkerClusterer(map, markers, mcOptions);
如果不“刷新” map 标记,是否可以暂时关闭聚类,然后再次将其重新打开?
最佳答案
您可以尝试将maxZoom和gridSize设置为最小。
markerClusterer.setMaxZoom(1);
markerClusterer.setGridSize(1);
markerClusterer.redraw();
在此之前,您可以保存以前的值(getMaxZoom()和getGridSize())。依靠reference,没有像enableClustering()这样的东西。
关于google-maps - 使用Google Maps API关闭集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7908722/