總覽
GMSMutablePath 是 CLLocationCoordinate2D 的動態 (可調整大小) 陣列。
所有座標都必須有效。GMSMutablePath 是可變動的 GMSPath 中的可變動對應項目。
沿用 GMSPath。
公開成員函式 | |
(無效) | - addCoordinate: |
在路徑結尾加上 coord 。 | |
(無效) | - addLatitude:經度: |
新增具有指定 lat/lng 的新 CLLocationCoordinate2D 執行個體。 | |
(無效) | - insertCoordinate:atIndex: |
在index 插入 coord 。 | |
(無效) | - replaceCoordinateAtIndex:withCoordinate: |
將 index 的座標替換為 coord 。 | |
(無效) | - removeCoordinateAtIndex: |
移除「index 」的項目。 | |
(無效) | - removeLastCoordinate |
移除路徑的最後一個座標。 | |
(無效) | - removeAllCoordinates |
移除這個路徑中的所有座標。 | |
(ID) | - initWithPath: |
使用另一個 GMSPath的內容初始化新分配的路徑。 | |
(NSUInteger) | - count |
取得路徑大小。 | |
(CLLocationCoordinate2D) | - 協調中心 AtIndex: |
如果 index >= 計數,則傳回 kCLLocationCoordinate2DInvalid。 | |
(NSString *) | - encodedPath |
以上述格式傳迴路徑的編碼字串。 | |
(執行個體類型) | - pathOffsetByLatitude:經度: |
將 deltaLatitude 和 deltaLongitude 新增至目前路徑的每個座標,以傳回新路徑。 | |
(雙倍) | - SegmentsForLength:Kind: |
根據路徑 kind ,傳迴路徑中對應 length 的片段數量。 | |
(CLLocationDistance) | - lengthOfKind: |
根據 kind 傳迴路徑長度。 | |
靜態公開成員函式 | |
(執行個體類型) | + 路徑 |
空白路徑的便利建構函式。 | |
(可為空值的執行個體類型)。 | + pathFromEncodedPath: |
從 encodedPath 初始化新分配的路徑。 |
成員函式說明文件
- (無效) addCoordinate: | (CLLocationCoordinate2D) | Coord |
在路徑結尾加上 coord
。
- (void) addLatitude: | (CLLocationDegrees) | latitude | |
經度: | (CLLocationDegrees) | 經度 | |
新增具有指定 lat/lng 的新 CLLocationCoordinate2D 執行個體。
- (void) insertCoordinate: | (CLLocationCoordinate2D) | Coord | |
atIndex: | (NSUInteger) | 索引 | |
在index
插入 coord
。
如果這個路徑小於路徑大小,請將所有座標往前移。否則,將以取代協調中心 AtIndex:withCoordinate: 的行為
- (void) replaceCoordinateAtIndex: | (NSUInteger) | 索引 | |
withCoordinate: | (CLLocationCoordinate2D) | coord | |
將 index
的座標替換為 coord
。
如果 index
位於結尾處,請使用未定義的座標擴充陣列。
- (無效) removeCoordinateAtIndex: | (NSUInteger) | 索引 |
移除「index
」的項目。
如果index
小於計數計數。如果 index
>= 計數,表示系統不顯示任何動作。
- (無效) removeLastCoordinate |
移除路徑的最後一個座標。
如果陣列是非空白的減量大小,如果陣列是空的,表示這只是無聲的操作。
- (無效) removeAllCoordinates |
移除這個路徑中的所有座標。
+ (執行個體類型) 路徑 |
空白路徑的便利建構函式。
- (ID) initWithPath: | (GMSPath *) | 路徑 |
使用另一個 GMSPath的內容初始化新分配的路徑。
- (NSUInteger) count |
取得路徑大小。
- (CLLocationCoordinate2D) 座標 AtIndex: | (NSUInteger) | 索引 |
如果 index
>= 計數,則傳回 kCLLocationCoordinate2DInvalid。
+ (可為空值的執行個體類型) pathFromEncodedPath: | (NSString *) | encodedPath |
從 encodedPath
初始化新分配的路徑。
格式如下:https://developers.google.com/maps/documentation/utilities/polylinealgorithm
- (NSString *) encodedPath |
以上述格式傳迴路徑的編碼字串。
- (執行個體類型) pathOffsetByLatitude: | (CLLocationDegrees) | 差異遷移 | |
經度: | (CLLocationDegrees) | deltaLongitude | |
將 deltaLatitude
和 deltaLongitude
新增至目前路徑的每個座標,以傳回新路徑。
不會修改目前的路徑。
- (雙重)區隔 ForLength: | (CLLocationDistance) | 長度 | |
kind: | (GMSLengthKind) | 種類 | |
根據路徑 kind
,傳迴路徑中對應 length
的片段數量。
請參閱 GMSLengthKind。
- (CLLocationDistance) lengthOfKind: | (GMSLengthKind) | 種類 |
根據 kind
傳迴路徑長度。
請參閱 GMSLengthKind。