Android google 映射 v2 聚类标记(如果它们彼此靠近)

Android google maps v2 cluster markers if they are close to each other

我有一个使用 google 地图并在其上放置标记的应用程序。问题是,我在运行时不知道标记的坐标。所以我的问题是,如果我的标记在附近并且在放大后将它们分散在适当的位置,是否有任何图书馆能够聚集我的标记?也可能在单击显示其内容的集群时出现?

当然有。有一个官方的 Map Utils 库:http://googlemaps.github.io/android-maps-utils/

它实际上做了很多事情:

  • 项目聚类
  • 自定义图标生成
  • 多段线decoding/encoding
  • 热图
  • 球面几何

随时查看聚类示例:https://github.com/googlemaps/android-maps-utils/blob/master/demo/src/com/google/maps/android/utils/demo/ClusteringDemoActivity.java