GoogleMap.OnCameraMoveStartedListener

  • GoogleMap.OnCameraMoveStartedListener is a callback interface triggered when the camera on a Google Map starts moving.

  • It provides the reason for the camera movement, which can be user gestures, API animations, or developer animations.

  • The onCameraMoveStarted() method is called when movement begins, providing the reason for the change.

  • Developers should avoid updating or animating the camera from within the onCameraMoveStarted() method.

  • This listener helps developers respond to camera movement and implement custom behaviors based on the cause.

public static interface GoogleMap.OnCameraMoveStartedListener

Callback interface for when the camera motion starts.

Constant Summary

int REASON_API_ANIMATION Non-gesture animation initiated in response to user actions.
int REASON_DEVELOPER_ANIMATION Developer initiated animation.
int REASON_GESTURE Camera motion initiated in response to user gestures on the map.

Public Method Summary

abstract void
onCameraMoveStarted(int reason)
Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.

Constants

public static final int REASON_API_ANIMATION

Non-gesture animation initiated in response to user actions. For example: zoom buttons, my location button, or marker clicks.

Constant Value: 2

public static final int REASON_DEVELOPER_ANIMATION

Developer initiated animation.

Constant Value: 3

public static final int REASON_GESTURE

Camera motion initiated in response to user gestures on the map. For example: pan, tilt, pinch to zoom, or rotate.

Constant Value: 1

Public Methods

public abstract void onCameraMoveStarted (int reason)

Called when the camera starts moving after it has been idle or when the reason for camera motion has changed. Do not update or animate the camera from within this method.

This is called on the Android UI thread.

Parameters
reason The reason for the camera change. Possible values: