GMSPath encapsulates an immutable array of CLLocationCooordinate2D. All the coordinates of a
GMSPath must be valid. The mutable counterpart is GMSMutablePath.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSPath\u003c/code\u003e is an immutable class representing an ordered sequence of geographical coordinates.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to initialize, encode/decode, and manipulate paths (e.g., offsetting coordinates).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSPath\u003c/code\u003e allows calculating the length of the path and its segments using different measurement kinds.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can easily access the coordinates stored within the path and determine its size.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSMutablePath\u003c/code\u003e is the mutable counterpart for dynamic path modifications.\u003c/p\u003e\n"]]],["`GMSPath` manages an immutable array of `CLLocationCoordinate2D`. Key actions include: creating a path (empty or from an existing one), getting the path's size or a coordinate at a specific index, initializing a path from or generating an encoded string representation. Additional methods include shifting all coordinates by a specified latitude/longitude delta, calculating segments for a given length along the path, and determining the total path length based on a defined length kind.\n"],null,["# GoogleMaps Framework Reference\n\nGMSPath\n=======\n\n @interface GMSPath : NSObject \u003cNSCopying, NSMutableCopying\u003e\n\n`GMSPath` encapsulates an immutable array of `CLLocationCooordinate2D`. All the coordinates of a\n`GMSPath` must be valid. The mutable counterpart is [GMSMutablePath](../Classes/GMSMutablePath.html).\n- `\n ``\n ``\n `\n\n ### [+path](#/c:objc(cs)GMSPath(cm)path)\n\n `\n ` \n Convenience constructor for an empty path. \n\n #### Declaration\n\n Objective-C \n\n + (nonnull instancetype)path;\n\n- `\n ``\n ``\n `\n\n ### [-initWithPath:](#/c:objc(cs)GMSPath(im)initWithPath:)\n\n `\n ` \n Initializes a newly allocated path with the contents of another `GMSPath`. \n\n #### Declaration\n\n Swift \n\n init(path: GMSPath)\n\n Objective-C \n\n - (nonnull id)initWithPath:(nonnull GMSPath *)path;\n\n- `\n ``\n ``\n `\n\n ### [-count](#/c:objc(cs)GMSPath(im)count)\n\n `\n ` \n Get size of path. \n\n #### Declaration\n\n Swift \n\n func count() -\u003e UInt\n\n Objective-C \n\n - (NSUInteger)count;\n\n- `\n ``\n ``\n `\n\n ### [-coordinateAtIndex:](#/c:objc(cs)GMSPath(im)coordinateAtIndex:)\n\n `\n ` \n Returns `kCLLocationCoordinate2DInvalid` if `index` \\\u003e= count. \n\n #### Declaration\n\n Swift \n\n func coordinate(at index: UInt) -\u003e CLLocationCoordinate2D\n\n Objective-C \n\n - (CLLocationCoordinate2D)coordinateAtIndex:(NSUInteger)index;\n\n- `\n ``\n ``\n `\n\n ### [+pathFromEncodedPath:](#/c:objc(cs)GMSPath(cm)pathFromEncodedPath:)\n\n `\n ` \n Initializes a newly allocated path from [-encodedPath](../Classes/GMSPath.html#/c:objc(cs)GMSPath(im)encodedPath). This format is described at:\n \u003chttps://developers.google.com/maps/documentation/utilities/polylinealgorithm\u003e \n\n #### Declaration\n\n Swift \n\n convenience init?(fromEncodedPath encodedPath: String)\n\n Objective-C \n\n + (nullable instancetype)pathFromEncodedPath:(nonnull NSString *)encodedPath;\n\n- `\n ``\n ``\n `\n\n ### [-encodedPath](#/c:objc(cs)GMSPath(im)encodedPath)\n\n `\n ` \n Returns an encoded string of the path in the format described above. \n\n #### Declaration\n\n Swift \n\n func encodedPath() -\u003e String\n\n Objective-C \n\n - (nonnull NSString *)encodedPath;\n\n- `\n ``\n ``\n `\n\n ### [-pathOffsetByLatitude:longitude:](#/c:objc(cs)GMSPath(im)pathOffsetByLatitude:longitude:)\n\n `\n ` \n Returns a new path obtained by adding `deltaLatitude` and `deltaLongitude` to each coordinate\n of the current path. Does not modify the current path. \n\n #### Declaration\n\n Swift \n\n func pathOffset(byLatitude deltaLatitude: CLLocationDegrees, longitude deltaLongitude: CLLocationDegrees) -\u003e Self\n\n Objective-C \n\n - (nonnull instancetype)pathOffsetByLatitude:(CLLocationDegrees)deltaLatitude\n longitude:(CLLocationDegrees)deltaLongitude;\n\n[GMSPathLength\n-------------](#/GMSPathLength)\n\n- `\n ``\n ``\n `\n\n ### [-segmentsForLength:kind:](#/c:objc(cs)GMSPath(im)segmentsForLength:kind:)\n\n `\n ` \n Returns the fractional number of segments along the path that correspond to `length`,\n interpreted according to `kind`. See [GMSLengthKind](../Enums/GMSLengthKind.html). \n\n #### Declaration\n\n Swift \n\n func segments(forLength length: CLLocationDistance, kind: ../Enums/GMSLengthKind.html) -\u003e Double\n\n Objective-C \n\n - (double)segmentsForLength:(CLLocationDistance)length kind:(../Enums/GMSLengthKind.html)kind;\n\n- `\n ``\n ``\n `\n\n ### [-lengthOfKind:](#/c:objc(cs)GMSPath(im)lengthOfKind:)\n\n `\n ` \n Returns the length of the path, according to `kind`. See [GMSLengthKind](../Enums/GMSLengthKind.html). \n\n #### Declaration\n\n Swift \n\n func length(of kind: ../Enums/GMSLengthKind.html) -\u003e CLLocationDistance\n\n Objective-C \n\n - (CLLocationDistance)lengthOfKind:(../Enums/GMSLengthKind.html)kind;"]]