# GoogleRidesharingConsumer Framework Reference

# GMTSLatLng

    @interface GMTSLatLng : https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCImmutableData.html

Object representing the latitude and longitude.
- `


  ### [latitude](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(py)latitude)


  ` Latitude associated with the object.

  #### Declaration

  Swift

      var latitude: Double { get }

  Objective-C

      @property (nonatomic, readonly) double latitude;

- `


  ### [longitude](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(py)longitude)


  ` Longitude associated with the object.

  #### Declaration

  Swift

      var longitude: Double { get }

  Objective-C

      @property (nonatomic, readonly) double longitude;

- `


  ### [+latLngFromCoordinate:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(cm)latLngFromCoordinate:)


  ` Creates and returns an initialized `GMTSLatLng` from given `CLLocationCoordinate2D`.

  #### Declaration

  Swift

      convenience init(from coordinate: CLLocationCoordinate2D)

  Objective-C

      + (nonnull instancetype)latLngFromCoordinate:(CLLocationCoordinate2D)coordinate;

- `


  ### [-initWithLatitude:longitude:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(im)initWithLatitude:longitude:)


  ` Initializes the object with the specified `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html#/c:objc(cs)GMTSLatLng(py)latitude` and \`longitude'.

  #### Declaration

  Swift

      init(latitude: Double, longitude: Double)

  Objective-C

      - (nonnull instancetype)initWithLatitude:(double)latitude
                                     longitude:(double)longitude;

- `


  ### [-init](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(im)init)


  ` Unavailable
  @remark Use `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng.html#/c:objc(cs)GMTSLatLng(im)initWithLatitude:longitude:`.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;

- `


  ### [-coordinate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(im)coordinate)


  ` Creates and returns a `CLLocationCoordinate2D` from current `GMTSLatLng`.

  #### Declaration

  Swift

      func coordinate() -> CLLocationCoordinate2D

  Objective-C

      - (CLLocationCoordinate2D)coordinate;

- `


  ### [-distanceFromLocation:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(im)distanceFromLocation:)


  ` Gets the lateral distance from the given latlng to the current location.

  #### Declaration

  Swift

      func distance(fromLocation latlng: GMTSLatLng) -> CLLocationDistance

  Objective-C

      - (CLLocationDistance)distanceFromLocation:(nonnull GMTSLatLng *)latlng;

- `


  ### [-isAlmostEqual:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTSLatLng#/c:objc(cs)GMTSLatLng(im)isAlmostEqual:)


  ` Indicates if the receiver is almost equal to another given `GMTSLatLng` object based on the
  constant, `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Constants/GMTSLatLngDegreeAlmostEqualTolerance.html`.

  #### Declaration

  Swift

      func isAlmostEqual(_ latlng: GMTSLatLng?) -> Bool

  Objective-C

      - (BOOL)isAlmostEqual:(nullable GMTSLatLng *)latlng;