【问题标题】:Is there a way to toggle MarkerClustererPlus有没有办法切换 MarkerClusterPlus
【发布时间】:2013-06-10 16:08:33
【问题描述】:

我使用 MarkerClustererPlus 对谷歌地图 (v3) 上的标记进行聚类

有没有办法用函数切换聚类。 也就是说,我不会影响标记,而只会切换群集图标的可见性。

为了显示它,我们有属性 - 重绘,但我找不到隐藏集群的属性。

【问题讨论】:

    标签: google-maps-api-3 google-maps-markers markerclusterer


    【解决方案1】:

    如果您只想隐藏所有集群,那么 Molle 博士的回答效果很好。如果您只想隐藏地图标记的子组/子部分,则需要刷新/重建。

    这是一个高级示例,可以帮助其他人通过 Google 搜索找到此页面。

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

    【讨论】:

      【解决方案2】:

      设置markerClusterer的map-option

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

      注意:当您将地图设置为空时,所有聚集标记都将显示为标记,我不确定这是否是所需的行为

      【讨论】:

      • 正是需要的。非常感谢!
      猜你喜欢
      • 2021-08-08
      • 2012-02-15
      • 1970-01-01
      • 1970-01-01
      • 2018-10-23
      • 1970-01-01
      • 1970-01-01
      • 2015-04-04
      • 1970-01-01
      相关资源
      最近更新 更多