【问题标题】:How to implement marker cluster in android maps v3?如何在 android maps v3 中实现标记集群?
【发布时间】:2016-03-21 11:49:40
【问题描述】:
    import com.google.maps.android.MarkerManager;
    import com.google.maps.android.clustering.algo.Algorithm;
    import com.google.maps.android.clustering.algo.NonHierarchicalDistanceBasedAlgorithm;
    import com.google.maps.android.clustering.algo.PreCachingAlgorithmDecorator;
    import com.google.maps.android.clustering.view.ClusterRenderer;
    import com.google.maps.android.clustering.view.DefaultClusterRenderer;

我收到地图未定义的错误。我正在按照谷歌指南设置标记聚类。 https://developers.google.com/maps/documentation/android-api/utility/marker-clustering

【问题讨论】:

  • 你需要将依赖compile 'com.google.maps.android:android-maps-utils:0.4+'添加到你的build.gradle
  • 你能发布处理标记聚类的整个代码吗?
  • 我已将 com.google.android.gms:play-services-maps:8.4.0 包含在 gradle 文件中
  • 是的,您需要 com.google.android.gms:play-services-maps:8.4.0,但还需要 compile 'com.google.maps.android:android-maps-utils:0.4+',因为标记聚类是 Google Maps API 实用程序库 (developers.google.com/maps/documentation/android-api/utility) 的一项功能
  • @antonio 谢谢 :)

标签: android google-maps google-maps-api-3


【解决方案1】:

由于标记聚类是Google Maps API Utility Library 的一个功能,您需要在build.gradle 中添加以下依赖项

compile 'com.google.maps.android:android-maps-utils:0.4+'

【讨论】:

    猜你喜欢
    • 2013-03-07
    • 1970-01-01
    • 1970-01-01
    • 2011-05-14
    • 1970-01-01
    • 2012-03-13
    • 1970-01-01
    • 2015-09-02
    • 2011-05-23
    相关资源
    最近更新 更多