# GoogleMaps Framework Reference

# GMSMutablePath

    @interface GMSMutablePath : https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPath.html

`GMSMutablePath` is a dynamic (resizable) array of `CLLocationCoordinate2D`. All coordinates
must be valid. `GMSMutablePath` is the mutable counterpart to the immutable `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSPath.html`.
- `


  ### [-addCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)addCoordinate:)


  ` Adds `coord` at the end of the path.

  #### Declaration

  Swift

      func add(_ coord: CLLocationCoordinate2D)

  Objective-C

      - (void)addCoordinate:(CLLocationCoordinate2D)coord;

- `


  ### [-addLatitude:longitude:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)addLatitude:longitude:)


  ` 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;

- `


  ### [-insertCoordinate:atIndex:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)insertCoordinate:atIndex:)


  ` Inserts `coord` at `index`.

  If this is smaller than the size of the path, shifts all coordinates forward by one. Otherwise,
  behaves as `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath.html#/c:objc(cs)GMSMutablePath(im)replaceCoordinateAtIndex:withCoordinate:`.

  #### Declaration

  Swift

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

  Objective-C

      - (void)insertCoordinate:(CLLocationCoordinate2D)coord
                       atIndex:(NSUInteger)index;

- `


  ### [-replaceCoordinateAtIndex:withCoordinate:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)replaceCoordinateAtIndex:withCoordinate:)


  ` 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;

- `


  ### [-removeCoordinateAtIndex:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)removeCoordinateAtIndex:)


  ` 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;

- `


  ### [-removeLastCoordinate](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)removeLastCoordinate)


  ` 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;

- `


  ### [-removeAllCoordinates](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMutablePath#/c:objc(cs)GMSMutablePath(im)removeAllCoordinates)


  ` Removes all coordinates in this path.

  #### Declaration

  Swift

      func removeAllCoordinates()

  Objective-C

      - (void)removeAllCoordinates;