AI-generated Key Takeaways
- 
          GMSPathis an immutable class representing an ordered sequence of geographical coordinates, ideal for drawing lines or defining areas on a map.
- 
          It provides methods for creating paths, accessing individual coordinates, and encoding/decoding paths using the Google Maps Polyline Algorithm. 
- 
          GMSPathallows for calculating path length and segment lengths using different metrics (e.g., geodesic or rhumb).
- 
          You can create a new path by offsetting each coordinate by specified latitude and longitude deltas. 
- 
          A mutable version, GMSMutablePath, allows for modifying the coordinates of a path.
GMSPath
@interface GMSPath : NSObject <NSCopying, NSMutableCopying>GMSPath encapsulates an immutable array of CLLocationCooordinate2D. All the coordinates of a
GMSPath must be valid. The mutable counterpart is GMSMutablePath.
- 
                  
                  Convenience constructor for an empty path. DeclarationObjective-C + (nonnull instancetype)path;
- 
                  
                  Initializes a newly allocated path with the contents of another GMSPath.DeclarationSwift init(path: GMSPath)Objective-C - (nonnull id)initWithPath:(nonnull GMSPath *)path;
- 
                  
                  Get size of path. DeclarationSwift func count() -> UIntObjective-C - (NSUInteger)count;
- 
                  
                  Returns kCLLocationCoordinate2DInvalidifindex>= count.DeclarationSwift func coordinate(at index: UInt) -> CLLocationCoordinate2DObjective-C - (CLLocationCoordinate2D)coordinateAtIndex:(NSUInteger)index;
- 
                  
                  Initializes a newly allocated path from -encodedPath. This format is described at: https://developers.google.com/maps/documentation/utilities/polylinealgorithmDeclarationSwift convenience init?(fromEncodedPath encodedPath: String)Objective-C + (nullable instancetype)pathFromEncodedPath:(nonnull NSString *)encodedPath;
- 
                  
                  Returns an encoded string of the path in the format described above. DeclarationSwift func encodedPath() -> StringObjective-C - (nonnull NSString *)encodedPath;
- 
                  
                  Returns a new path obtained by adding deltaLatitudeanddeltaLongitudeto each coordinate of the current path. Does not modify the current path.DeclarationSwift func pathOffset(byLatitude deltaLatitude: CLLocationDegrees, longitude deltaLongitude: CLLocationDegrees) -> SelfObjective-C - (nonnull instancetype)pathOffsetByLatitude:(CLLocationDegrees)deltaLatitude longitude:(CLLocationDegrees)deltaLongitude;
- 
                  
                  Returns the fractional number of segments along the path that correspond to length, interpreted according tokind. SeeGMSLengthKind.DeclarationSwift func segments(forLength length: CLLocationDistance, kind: GMSLengthKind) -> DoubleObjective-C - (double)segmentsForLength:(CLLocationDistance)length kind:(GMSLengthKind)kind;
- 
                  
                  Returns the length of the path, according to kind. SeeGMSLengthKind.DeclarationSwift func length(of kind: GMSLengthKind) -> CLLocationDistanceObjective-C - (CLLocationDistance)lengthOfKind:(GMSLengthKind)kind;