I am reading the [Google Maps Android API Utility Library][1] and in order to initialise the clustering manager I need to put this line of code:
getMap().setOnCameraChangeListener(mClusterManager);
My question is what I need to do if I have more things to do when the camera changes position (for example bringing more items/markers from server)?
For marker click event, the documentation states the following:
If you want to add specific functionality in response to a marker
click event, set the map'sOnMarkerClickListener()to the
ClusterManager, since ClusterManager implements the listener.
I am not sure I understand what is said in this sentence and if it will work for the camera change event.
mMap.setOnCameraChangeListener(new OnCameraChangeListener() {
@Override
public void onCameraChange(CameraPosition cameraPosition) {
mClusterManager.onCameraChange(cameraPosition);
// Your custom code here
}
});
Most helpful comment
mMap.setOnCameraChangeListener(new OnCameraChangeListener() {