GMSPath Class Reference


Overview

GMSPath encapsulates an immutable array of CLLocationCooordinate2D.

All the coordinates of a GMSPath must be valid. The mutable counterpart is GMSMutablePath.

Inherited by GMSMutablePath.

Public Member Functions

(id) - initWithPath:
 Initializes a newly allocated path with the contents of another GMSPath.
(NSUInteger) - count
 Get size of path.
(CLLocationCoordinate2D) - coordinateAtIndex:
 Returns kCLLocationCoordinate2DInvalid if index >= count.
(NSString *) - encodedPath
 Returns an encoded string of the path in the format described above.
(instancetype) - pathOffsetByLatitude:longitude:
 Returns a new path obtained by adding deltaLatitude and deltaLongitude to each coordinate of the current path.
(double) - segmentsForLength:kind:
 Returns the fractional number of segments along the path that correspond to length, interpreted according to kind.
(CLLocationDistance) - lengthOfKind:
 Returns the length of the path, according to kind.

Static Public Member Functions

(instancetype) + path
 Convenience constructor for an empty path.
(nullable instancetype) + pathFromEncodedPath:
 Initializes a newly allocated path from encodedPath.

Member Function Documentation

+ (instancetype) path

Convenience constructor for an empty path.

- (id) initWithPath: (GMSPath *)  path

Initializes a newly allocated path with the contents of another GMSPath.

- (NSUInteger) count

Get size of path.

- (CLLocationCoordinate2D) coordinateAtIndex: (NSUInteger)  index

Returns kCLLocationCoordinate2DInvalid if index >= count.

+ (nullable instancetype) pathFromEncodedPath: (NSString *)  encodedPath

Initializes a newly allocated path from encodedPath.

This format is described at: https://developers.google.com/maps/documentation/utilities/polylinealgorithm

- (NSString *) encodedPath

Returns an encoded string of the path in the format described above.

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

Returns a new path obtained by adding deltaLatitude and deltaLongitude to each coordinate of the current path.

Does not modify the current path.

- (double) segmentsForLength: (CLLocationDistance)  length
kind: (GMSLengthKind kind 

Returns the fractional number of segments along the path that correspond to length, interpreted according to kind.

See GMSLengthKind.

- (CLLocationDistance) lengthOfKind: (GMSLengthKind kind

Returns the length of the path, according to kind.

See GMSLengthKind.