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
答案 0 :(得分:2)
由于标记聚类是Google Maps API Utility Library的功能,您需要将以下依赖关系添加到build.gradle
compile 'com.google.maps.android:android-maps-utils:0.4+'