GoogleMap.OnCameraMoveStartedListener
Stay organized with collections
Save and categorize content based on your preferences.
Callback interface for when the camera motion starts.
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:
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleMap.OnCameraMoveStartedListener\u003c/code\u003e is a callback interface triggered when the camera on a Google Map starts moving.\u003c/p\u003e\n"],["\u003cp\u003eIt provides the reason for the camera movement, which can be user gestures, API animations, or developer animations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eonCameraMoveStarted()\u003c/code\u003e method is called when movement begins, providing the reason for the change.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should avoid updating or animating the camera from within the \u003ccode\u003eonCameraMoveStarted()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThis listener helps developers respond to camera movement and implement custom behaviors based on the cause.\u003c/p\u003e\n"]]],[],null,["# GoogleMap.OnCameraMoveStartedListener\n\npublic static interface **GoogleMap.OnCameraMoveStartedListener** \nCallback interface for when the camera motion starts. \n\n### Constant Summary\n\n|-----|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|\n| int | [REASON_API_ANIMATION](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_API_ANIMATION) | Non-gesture animation initiated in response to user actions. |\n| int | [REASON_DEVELOPER_ANIMATION](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_DEVELOPER_ANIMATION) | Developer initiated animation. |\n| int | [REASON_GESTURE](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_GESTURE) | Camera motion initiated in response to user gestures on the map. |\n\n### Public Method Summary\n\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onCameraMoveStarted](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#onCameraMoveStarted(int))(int reason) Called when the camera starts moving after it has been idle or when the reason for camera motion has changed. |\n\nConstants\n---------\n\n#### public static final int\n**REASON_API_ANIMATION**\n\nNon-gesture animation initiated in response to user actions. For example: zoom\nbuttons, my location button, or marker clicks. \nConstant Value: 2 \n\n#### public static final int\n**REASON_DEVELOPER_ANIMATION**\n\nDeveloper initiated animation. \nConstant Value: 3 \n\n#### public static final int\n**REASON_GESTURE**\n\nCamera motion initiated in response to user gestures on the map. For example: pan,\ntilt, pinch to zoom, or rotate. \nConstant Value: 1\n\nPublic Methods\n--------------\n\n#### public abstract void **onCameraMoveStarted** (int reason)\n\nCalled when the camera starts moving after it has been idle or when the reason for\ncamera motion has changed. Do not update or animate the camera from within this\nmethod.\n\nThis is called on the Android UI thread. \n\n##### Parameters\n\n| reason | The reason for the camera change. Possible values: - [REASON_GESTURE](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_GESTURE): User gestures on the map. - [REASON_API_ANIMATION](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_API_ANIMATION): Default animations resulting from user interaction. - [REASON_DEVELOPER_ANIMATION](/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#REASON_DEVELOPER_ANIMATION): Developer animations. |\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]