GoogleMap.OnMarkerDragListener
標記上拖曳事件的回呼介面。
系統會在 Android UI 執行緒上叫用事件監聽器。
公用方法
公用抽象
void
onMarkerDrag
(Marker 標記)
公用抽象
void
onMarkerDragEnd
(Marker 標記)
公用抽象
void
onMarkerDragStart
(Marker 標記)
在開始拖曳標記時呼叫。您可以透過 getPosition()
存取標記的位置;這個位置可能會與拖曳開始之前的位置不同,因為標記會彈出觸控點上方。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-06-16 (世界標準時間)。
[null,null,["上次更新時間:2025-06-16 (世界標準時間)。"],[[["`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"]]