Search in sources :

Example 1 with OnCameraIdleListener

use of com.google.android.libraries.maps.GoogleMap.OnCameraIdleListener in project android-samples by googlemaps.

the class VisibleRegionDemoActivity method onMapReady.

@Override
public void onMapReady(GoogleMap map) {
    mMap = map;
    // Move to a place with indoor (SFO airport).
    mMap.setPadding(currentLeft, currentTop, currentRight, currentBottom);
    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(SFO, 18));
    // Add a marker to the Opera House.
    mMap.addMarker(new MarkerOptions().position(SOH).title("Sydney Opera House"));
    // Add a camera idle listener.
    mMap.setOnCameraIdleListener(new OnCameraIdleListener() {

        @Override
        public void onCameraIdle() {
            mMessageView.setText("CameraChangeListener: " + mMap.getCameraPosition());
        }
    });
}
Also used : MarkerOptions(com.google.android.libraries.maps.model.MarkerOptions) OnCameraIdleListener(com.google.android.libraries.maps.GoogleMap.OnCameraIdleListener)

Aggregations

OnCameraIdleListener (com.google.android.libraries.maps.GoogleMap.OnCameraIdleListener)1 MarkerOptions (com.google.android.libraries.maps.model.MarkerOptions)1