總覽
事件的委派項目GMSMapView 。
公開成員函式 | |
(無效) | - mapView:willMove: |
在地圖的相機變更之前呼叫,可能是由於手勢、動畫 (例如輕觸「我的位置」按鈕)、透過相機明確更新,或是圖層上的動畫長度為零。 | |
(無效) | - mapView:didChangeCameraPosition: |
在地圖上的任何動畫或手勢期間重複呼叫 (如果相機已明確設定,則為一次呼叫)。 | |
(無效) | - mapView:idleAtCameraPosition: |
當地圖處於閒置狀態,且所有未完成的手勢或動畫完成後 (或相機明確設定之後) 會呼叫此方法。 | |
(無效) | - mapView:didTapAtCoordinate: |
在特定座標的輕觸手勢之後呼叫,但僅在沒有輕觸標記時呼叫。 | |
(無效) | - mapView:didLongPressAtCoordinate: |
在特定座標長按手勢後呼叫。 | |
(BOOL) | - mapView:didTapMarker: |
在輕觸標記後呼叫。 | |
(無效) | - mapView:didTapInfoWindowOfMarker: |
在輕觸標記的資訊視窗後,會呼叫此方法。 | |
(無效) | - mapView:didLongPressInfoWindowOfMarker: |
長按標記的資訊視窗後,會呼叫此方法。 | |
(無效) | - mapView:didTapOverlay: |
在輕觸疊加層後呼叫。 | |
(無效) | - mapView:didTapPOIWithPlaceID:name:location: |
在輕觸搜尋點後呼叫。 | |
(可為空值的 UIView *) | - mapView:markerInfoWindow: |
當標記即將成為選取時呼叫,並提供一個選用的自訂資訊視窗,如果此方法傳回 UIView,就會用於該標記。 | |
(可為空值的 UIView *) | - mapView:markerInfoContents: |
在 mapView:markerInfoWindow: 傳回 nil 時呼叫。 | |
(無效) | - mapView:didCloseInfoWindowOfMarker: |
當標記的資訊視窗關閉時,會呼叫此方法。 | |
(無效) | - mapView:didBeginDraggingMarker: |
在開始拖曳標記時呼叫。 | |
(無效) | - mapView:didEndDraggingMarker: |
在拖曳標記後呼叫 。 | |
(無效) | - mapView:didDragMarker: |
在拖曳標記時呼叫。 | |
(BOOL) | - didTapMyLocationButtonForMapView: |
在輕觸「我的位置」按鈕時呼叫。 | |
(無效) | - mapView:didTapMyLocation: |
在輕觸「我的位置」點時呼叫。 | |
(無效) | - mapViewDidStartTileRendering: |
當圖塊要求完畢或標籤開始算繪時,會呼叫此方法。 | |
(無效) | - mapViewDidFinishTileRendering: |
載入所有圖塊 (或永久失敗) 並算繪標籤時,會呼叫此方法。 | |
(無效) | - mapViewSnapshotReady: |
地圖穩定時 (已載入圖塊、已算繪的標籤、相機閒置) 以及疊加層物件算繪時呼叫。 | |
(無效) | - mapView:didChangeMapCapabilities: |
每次地圖功能變更時都會呼叫。 | |
(無效) | - mapView:didTapFeatures:inFeatureLayer:atLocation: |
輕觸資料導向樣式地圖項目圖層中的地圖項目後,會呼叫此方法。 |
成員功能說明文件
- (避免) mapView: | (GMSMapView *) | mapView | |
willMove: | (BOOL) | 手勢 | |
[optional] |
在地圖的相機變更之前呼叫,可能是由於手勢、動畫 (例如輕觸「我的位置」按鈕)、透過相機明確更新,或是圖層上的動畫長度為零。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 手勢 如果為「是」,表示發生了使用者手勢。
- (避免) mapView: | (GMSMapView *) | mapView | |
doChangeCameraPosition: | (GMSCameraPosition *) | position | |
[optional] |
在地圖上的任何動畫或手勢期間重複呼叫 (如果相機已明確設定,則為一次呼叫)。
可能無法為所有的中繼相機位置呼叫此方法。一律會針對動畫或手勢的最終位置呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
BatteryAtCameraPosition: | (GMSCameraPosition *) | position | |
[optional] |
當地圖處於閒置狀態,且所有未完成的手勢或動畫完成後 (或相機明確設定之後) 會呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapAtCoordinate: | (CLLocationCoordinate2D) | Coordinate | |
[optional] |
在特定座標的輕觸手勢之後呼叫,但僅在沒有輕觸標記時呼叫。
在取消選取任何目前選取的標記 (輕觸地圖上的隱含動作) 之前,系統會呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
doLongPressAtCoordinate: | (CLLocationCoordinate2D) | Coordinate | |
[optional] |
在特定座標長按手勢後呼叫。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 座標 已輕觸的位置。
- (BOOL) mapView: | (GMSMapView *) | mapView | |
doTapMarker: | (GMSMarker *) | marker | |
[optional] |
在輕觸標記後呼叫。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 馬克筆 已輕觸的標記。
- 傳回:
- 如果這個委派項目處理了輕觸事件,導致地圖無法執行預設選取行為,則為 NO;如果地圖應繼續採用預設的選取行為,則為 NO。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapInfoWindowOfMarker: | (GMSMarker *) | marker | |
[optional] |
在輕觸標記的資訊視窗後,會呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
doLongPressInfoWindowOfMarker: | (GMSMarker *) | marker | |
[optional] |
長按標記的資訊視窗後,會呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapOverlay: | (GMSOverlay *) | 重疊 | |
[optional] |
在輕觸疊加層後呼叫。
輕觸標記時不會呼叫此方法。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 overlay 所輕觸的重疊元素。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapPOIWithPlaceID: | (NSString *) | placeID | |
name: | (NSString *) | name | |
位置: | (CLLocationCoordinate2D) | location | |
[optional] |
在輕觸搜尋點後呼叫。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 地點 ID 已輕觸搜尋點的 placeID。 名稱 已輕觸的搜尋點名稱。 位置 已輕觸搜尋點的位置。
- (可為空值 UIView *) mapView: | (GMSMapView *) | mapView | |
markerInfoWindow: | (GMSMarker *) | marker | |
[optional] |
當標記即將成為選取時呼叫,並提供一個選用的自訂資訊視窗,如果此方法傳回 UIView,就會用於該標記。
如果您在呼叫此方法後變更檢視,這些變更不一定會反映在轉譯後的版本。
傳回的 UIView 對任一維度的限制不得大於 500 點。由於每次都只會顯示一個資訊視窗,因此傳回的檢視可以在其他資訊視窗之間重複使用。
在這個呼叫期間,將標記從地圖中移除或變更地圖選取的標記,會導致未定義的行為。
- 傳回:
- 指定標記的自訂資訊視窗,或 nil 代表預設值
- (可為空值 UIView *) mapView: | (GMSMapView *) | mapView | |
MarkerInfoContents: | (GMSMarker *) | marker | |
[optional] |
在 mapView:markerInfoWindow: 傳回 nil 時呼叫。
如果使用此方法傳回檢視,則會放在預設的資訊視窗頁框中。如果這個方法傳回 nil,就會改用預設顯示。
- 參數:
-
地圖檢視 按下的地圖檢視。 馬克筆 已按下的標記。
- 傳回:
- 在資訊視窗中顯示為內容的自訂檢視,或 nil 改用預設內容顯示
- (避免) mapView: | (GMSMapView *) | mapView | |
doCloseInfoWindowOfMarker: | (GMSMarker *) | marker | |
[optional] |
當標記的資訊視窗關閉時,會呼叫此方法。
- (避免) mapView: | (GMSMapView *) | mapView | |
doBeginDraggingMarker: | (GMSMarker *) | marker | |
[optional] |
在開始拖曳標記時呼叫。
- (避免) mapView: | (GMSMapView *) | mapView | |
doEndDraggingMarker: | (GMSMarker *) | marker | |
[optional] |
在拖曳標記後呼叫 。
- (避免) mapView: | (GMSMapView *) | mapView | |
doDragMarker: | (GMSMarker *) | marker | |
[optional] |
在拖曳標記時呼叫。
- (BOOL) didTapMyLocationButtonForMapView: | (GMSMapView *) | mapView | [optional] |
在輕觸「我的位置」按鈕時呼叫。
- 傳回:
- 如果監聽器已消耗事件 (即不應發生預設行為),則否 (亦即應會執行預設行為)。預設行為是讓攝影機移動到裝置位置的中心。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapMyLocation: | (CLLocationCoordinate2D) | location | |
[optional] |
在輕觸「我的位置」點時呼叫。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 位置 輕觸位置點的裝置所在位置。
- (void) mapViewDidStartTileRendering: | (GMSMapView *) | mapView | [optional] |
當圖塊要求完畢或標籤開始算繪時,會呼叫此方法。
- (void) mapViewDidFinishTileRendering: | (GMSMapView *) | mapView | [optional] |
載入所有圖塊 (或永久失敗) 並算繪標籤時,會呼叫此方法。
- (void) mapViewSnapshotReady: | (GMSMapView *) | mapView | [optional] |
地圖穩定時 (已載入圖塊、已算繪的標籤、相機閒置) 以及疊加層物件算繪時呼叫。
- (避免) mapView: | (GMSMapView *) | mapView | |
doChangeMapCapabilities: | (GMSMapCapabilityFlags)。 | mapCapabilities | |
[optional] |
每次地圖功能變更時都會呼叫。
- 參數:
-
地圖檢視 已變更 mapCapabilities 的地圖檢視。 mapCapabilities 代表目前地圖上功能的旗標。
- (避免) mapView: | (GMSMapView *) | mapView | |
doTapFeatures: | (NSArray< id< GMSFeature >> *) | 功能 | |
inFeatureLayer: | (GMSFeatureLayer *) | featureLayer | |
atLocation: | (CLLocationCoordinate2D) | location | |
[optional] |
輕觸資料導向樣式地圖項目圖層中的地圖項目後,會呼叫此方法。
所有與輕觸點重疊的地圖項目都會納入。如果地圖項目屬於不同的地圖項目圖層,則系統會多次呼叫此方法 (每個地圖項目圖層一次)。
不同地圖項目圖層上的事件之間,或地圖項目圖層和基本地圖上的其他實體項目之間沒有一定的順序。
- 參數:
-
地圖檢視 已輕觸的地圖檢視。 功能 在圖層中點選的所有地圖項目陣列。 featureLayer 包含功能圖層的地圖項目圖層。 位置 實際輕觸點的位置。