GoogleMap.OnMapClickListener
使用者輕觸地圖時的回呼介面。
系統會在 Android UI 執行緒上叫用事件監聽器。
公用方法
公用抽象
void
onMapClick
(LatLng 點)
當使用者在地圖上做出輕觸手勢時,會呼叫此方法,但前提是地圖的所有疊加層都沒有處理該手勢。這個方法的實作一律是在 Android UI 執行緒上叫用。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-06-13 (世界標準時間)。
[null,null,["上次更新時間:2025-06-13 (世界標準時間)。"],[[["`GoogleMap.OnMapClickListener` is an interface used to handle user tap interactions on a Google Map."],["The `onMapClick` method within this interface is triggered when a user taps on the map, providing the geographical coordinates of the tapped location, but only if no other map overlays have captured the event."],["This interaction is processed on the main Android UI thread, ensuring smooth handling of the event within the application's lifecycle."]]],["The `GoogleMap.OnMapClickListener` interface provides a callback for map tap events. The `onMapClick` method is triggered when a user taps the map, provided no map overlays handled the tap. This method, always executed on the Android UI thread, receives a `LatLng` object (`point`) representing the geographical coordinates of the tap. This allows the user to get the point tapped by the user on the map.\n"]]