I´m using google-maps-utils (only marker clustering) and the code is read-only.
dependencies {
compile 'com.google.maps.android:android-maps-utils:0.5+'
}
I want to comment 3 lines in ClusterManager.java
/**
* Might re-cluster.
*/
@Override
public void onCameraIdle() {
if (mRenderer instanceof GoogleMap.OnCameraIdleListener) {
((GoogleMap.OnCameraIdleListener) mRenderer).onCameraIdle();
}
// Don't re-compute clusters if the map has just been panned/tilted/rotated.
CameraPosition position = mMap.getCameraPosition();
// if (mPreviousCameraPosition != null && mPreviousCameraPosition.zoom == position.zoom) {
// return;
// }
mPreviousCameraPosition = mMap.getCameraPosition();
cluster();
}
I'm trying to import the modules but I'm doing something wrong.
If this is a high level class which you will use directly you can simply extend this class and override the method:
public class MyClusterManager<T extends ClusterItem> extends ClusterManager<T> {
@Override
public void onCameraIdle() {
if (mRenderer instanceof GoogleMap.OnCameraIdleListener) {
((GoogleMap.OnCameraIdleListener) mRenderer).onCameraIdle();
}
CameraPosition position = mMap.getCameraPosition();
mPreviousCameraPosition = mMap.getCameraPosition();
cluster();
}
}
and then:
ClusterManager<MyClusterItem> clusterManager = new MyClusterManager<MyClusterItem>();
// do something with your own clusterManager ...