GoogleMap.OnMarkerDragListener
Callback interface for drag events on markers.
Listeners will be invoked on the Android UI thread.
Public Method Summary
abstract
void
|
|
abstract
void
|
|
abstract
void
|
|
Public Methods
public
abstract
void
onMarkerDrag
(Marker marker)
Called repeatedly while a marker is being dragged. The marker's location can be accessed via
getPosition()
.
Parameters
marker |
The marker being dragged.
|
public
abstract
void
onMarkerDragEnd
(Marker marker)
Called when a marker has finished being dragged. The marker's location can be accessed via
getPosition()
.
Parameters
marker |
The marker that was dragged.
|
public
abstract
void
onMarkerDragStart
(Marker marker)
Called when a marker starts being dragged. The marker's location can be accessed via getPosition()
; this position may be different to the position prior to the start of
the drag because the marker is popped up above the touch point.
Parameters
marker |
The marker being dragged.
|
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 2025-05-12 UTC.
[null,null,["Last updated 2025-05-12 UTC."],[[["`GoogleMap.OnMarkerDragListener` is a callback interface used to handle marker drag events on Google Maps in Android."],["It provides three methods: `onMarkerDragStart`, `onMarkerDrag`, and `onMarkerDragEnd`, which are triggered when a marker drag starts, continues, and ends, respectively."],["All listener methods are executed on the Android UI thread, ensuring they can interact with UI elements directly."],["The `Marker` object provided to the listener methods allows access to the marker's current position during the drag process."]]],["`GoogleMap.OnMarkerDragListener` is a callback interface for marker drag events on Android. It contains three key methods: `onMarkerDragStart`, triggered when a marker drag begins; `onMarkerDrag`, called continuously during the drag; and `onMarkerDragEnd`, invoked when the drag finishes. Each method receives the dragged `Marker` object, and its position can be obtained with `getPosition()`. All events are executed on the UI thread.\n"]]