GoogleMaps Framework Reference

GMSMutablePath

@interface GMSMutablePath : GMSPath

GMSMutablePath is a dynamic (resizable) array of CLLocationCoordinate2D. All coordinates must be valid. GMSMutablePath is the mutable counterpart to the immutable GMSPath.

  • Adds coord at the end of the path.

    Declaration

    Swift

    func add(_ coord: CLLocationCoordinate2D)

    Objective-C

    - (void)addCoordinate:(CLLocationCoordinate2D)coord;
  • Adds a new CLLocationCoordinate2D instance with the given lat/lng.

    Declaration

    Swift

    func addLatitude(_ latitude: CLLocationDegrees, longitude: CLLocationDegrees)

    Objective-C

    - (void)addLatitude:(CLLocationDegrees)latitude
              longitude:(CLLocationDegrees)longitude;
  • Inserts coord at index.

    If this is smaller than the size of the path, shifts all coordinates forward by one. Otherwise, behaves as -replaceCoordinateAtIndex:withCoordinate:.

    Declaration

    Swift

    func insert(_ coord: CLLocationCoordinate2D, at index: UInt)

    Objective-C

    - (void)insertCoordinate:(CLLocationCoordinate2D)coord
                     atIndex:(NSUInteger)index;
  • Replace the coordinate at index with coord. If index is after the end, grows the array with an undefined coordinate.

    Declaration

    Swift

    func replaceCoordinate(at index: UInt, with coord: CLLocationCoordinate2D)

    Objective-C

    - (void)replaceCoordinateAtIndex:(NSUInteger)index
                      withCoordinate:(CLLocationCoordinate2D)coord;
  • Remove entry at index.

    If index < count decrements size. If index >= count this is a silent no-op.

    Declaration

    Swift

    func removeCoordinate(at index: UInt)

    Objective-C

    - (void)removeCoordinateAtIndex:(NSUInteger)index;
  • Removes the last coordinate of the path.

    If the array is non-empty decrements size. If the array is empty, this is a silent no-op.

    Declaration

    Swift

    func removeLastCoordinate()

    Objective-C

    - (void)removeLastCoordinate;
  • Removes all coordinates in this path.

    Declaration

    Swift

    func removeAllCoordinates()

    Objective-C

    - (void)removeAllCoordinates;