總覽
此類別代表 Consumer SDK for iOS 中的主要檢視畫面。
您可以使用這個類別建立可自訂的地圖,以便使用者利用 `consumerMapStylecoordinator` 建立自訂標記和折線。
- 注意:
- 請使用預設建構函式 [[GMTCMapView alloc] initWithFrame:] 將這張地圖例項化。
GMTCMapView 只能從主執行緒讀取及修改,類似於 GMSMapView 和所有 UIKit 物件。從其他執行緒呼叫這些方法會導致例外狀況或未定義的行為。
公開成員函式 | |
(執行個體類型) | - initWithFrame: |
GMTCMapView 物件的初始化作業。 | |
(可為空值的例項類型) | - initWithCoder: |
使用編碼器進行初始化。 | |
(void) | - resetCamera |
根據目前進行中的 mapView 工作階段,將 mapView 的相機重設為預設位置。 | |
(void) | - redrawRidesharingOverlays |
強制重新繪製目前地圖檢視中所呈現共乘的所有疊加層。 | |
(void) | - showMapViewSession: |
在 mapView 上顯示 mapView 工作階段。 | |
(void) | - hideMapViewSession: |
隱藏 mapView 上的 mapView 工作階段。 | |
(void) | - hideAllMapViewSessions |
隱藏 mapView 上的所有 mapView 工作階段。 | |
(NSArray< id < GMTCMapViewSession >> *) | - activeSessions |
傳回 mapView 上目前顯示的所有 mapView 工作階段。 | |
資源 | |
id< GMTCMapViewDelegate > | 委派 |
地圖檢視的委派項目。 | |
GMTCConsumerMapStyleCoordinator * | consumerMapStyleCoordinator |
為程式庫的標記、折線和多邊形保留可自訂的 UI 選項。 | |
BOOL | allowCameraAutoUpdate |
允許地圖檢視的相機自動更新。 |
成員函式說明文件
- (instancetype) initWithFrame: | (CGRect) | 影格 |
GMTCMapView 物件的初始化作業。
- (可為空值例項類型) initWithCoder: | (NSCoder *) | aDecoder |
使用編碼器進行初始化。
- 注意:
- 請改用
-initWithFrame
。
- (void) resetCamera |
根據目前進行中的 mapView 工作階段,將 mapView 的相機重設為預設位置。
- (void) redrawRidesharingOverlays |
強制重新繪製目前地圖檢視中所呈現共乘的所有疊加層。
這些疊加層包括 GMTCCustomizableMarkerType
參照的共乘服務相關標記、乘車複合區域和行程路線的多邊形。您也可以使用這個方法,在 GMTCMapView 上呼叫 clear
,重新繪製清理乾淨的疊加層。
- 注意:
- 這個 API 不會還原從應用程式層新增的疊加層。
- (void) showMapViewSession: | (id< GMTCMapViewSession >) | 工作階段 |
在 mapView 上顯示 mapView 工作階段。
- (void) hideMapViewSession: | (id< GMTCMapViewSession >) | 工作階段 |
隱藏 mapView 上的 mapView 工作階段。
- (void) hideAllMapViewSessions |
隱藏 mapView 上的所有 mapView 工作階段。
- (NSArray<id<GMTCMapViewSession>> *) activeSessions |
傳回 mapView 上目前顯示的所有 mapView 工作階段。
屬性說明文件
- (id<GMTCMapViewDelegate>) 委派 [read, write, assign] |
地圖檢視的委派項目。
- (GMTCConsumerMapStyleCoordinator*) consumerMapStyleCoordinator [read, assign] |
為程式庫的標記、折線和多邊形保留可自訂的 UI 選項。
- (BOOL) allowCameraAutoUpdate [read, write, assign] |
允許地圖檢視的相機自動更新。
預設值為「YES」。