Android-maps-utils: OnCameraChangeListener extra functionality (Clustering)

Created on 23 May 2014  路  1Comment  路  Source: googlemaps/android-maps-utils

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's OnMarkerClickListener() 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.

Most helpful comment

mMap.setOnCameraChangeListener(new OnCameraChangeListener() {

        @Override
        public void onCameraChange(CameraPosition cameraPosition) {
            mClusterManager.onCameraChange(cameraPosition);

            // Your custom code here

        }
    });

>All comments

mMap.setOnCameraChangeListener(new OnCameraChangeListener() {

        @Override
        public void onCameraChange(CameraPosition cameraPosition) {
            mClusterManager.onCameraChange(cameraPosition);

            // Your custom code here

        }
    });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

WeiLinJoe picture WeiLinJoe  路  4Comments

YuriPopiv picture YuriPopiv  路  5Comments

harold-hernandez30 picture harold-hernandez30  路  3Comments

leicht-io picture leicht-io  路  6Comments

mengoni picture mengoni  路  4Comments