GMSPath 類別參考資料

GMSPath 類別參考資料

總覽

GMSPath:封裝不可變的 CLLocationCooordinate2D 陣列。

所有座標GMSPath必須有效。可變動的對應項目為GMSMutablePath

由繼承GMSMutablePath

公開成員函式

(id)- initWithPath:
 用其他的內容初始化剛分配的路徑GMSPath
(NSUInteger)- 計數
 取得路徑大小。
(CLLocationCoordinate2D) - CoordinateAtIndex:
 如果 index >= 計數,則傳回 kCLLocationCoordinate2DInvalid。
(NSString *)- encodedPath
 以上述格式傳迴路徑的編碼字串。
(執行個體類型)- pathOffsetByLatitude:longitude:
 傳回透過將 deltaLatitudedeltaLongitude 新增至目前路徑的每個座標,所取得的新路徑。
(雙精度浮點數)- segmentsForLength:Kind:
 傳迴路徑沿途對應 length 的分數片段,被解讀為 kind
(CLLocationDistance)- lengthOfKind:
 根據 kind 傳迴路徑的長度。

靜態公開成員函式

(執行個體類型)+ path
 空白路徑的便利建構函式。
(可為空值的例項類型)+ pathFromEncodedPath:
 初始化 encodedPath 中新分配的路徑。

成員函式說明文件

+ (執行個體類型) 路徑

空白路徑的便利建構函式。

- (id) initWithPath: (GMSPath *) 路徑

用其他的內容初始化剛分配的路徑GMSPath

- (NSUInteger) 計數

取得路徑大小。

- (CLLocationCoordinate2D) CoordinateAtIndex: (NSUInteger) 索引

如果 index >= 計數,則傳回 kCLLocationCoordinate2DInvalid。

+ (可為空值例項類型) pathFromEncodedPath: (NSString *) encodedPath

初始化 encodedPath 中新分配的路徑。

格式說明請見:https://developers.google.com/maps/documentation/utilities/polylinealgorithm

- (NSString *) encodedPath

以上述格式傳迴路徑的編碼字串。

- (instancetype) pathOffsetByLatitude: (CLLocationDegrees) deltaLatitude
longitude: (CLLocationDegrees) deltaLongitude

傳回透過將 deltaLatitudedeltaLongitude 新增至目前路徑的每個座標,所取得的新路徑。

不會修改目前的路徑。

- (雙精度區隔)ForLength: (CLLocationDistance) 長度
kind: (GMSLengthKind) 種類

傳迴路徑沿途對應 length 的分數片段,被解讀為 kind

請參閱 GMSLengthKind。

- (CLLocationDistance) lengthOfKind: (GMSLengthKind) 種類

根據 kind 傳迴路徑的長度。

請參閱 GMSLengthKind。