LatLng

data class LatLng(@FloatRange(from = -90.0, to = 90.0) val latitude: Double, @FloatRange(from = -1.7976931348623157E308, to = 1.7976931348623157E308) val longitude: Double) : Parcelable

An object describing a specific location with Latitude and Longitude in decimal degrees.

Parameters

latitude

Latitude in decimal degrees

longitude

Longitude in decimal degrees

Constructors

Link copied to clipboard
constructor(location: Location)
constructor(@FloatRange(from = -90.0, to = 90.0) latitude: Double, @FloatRange(from = -1.7976931348623157E308, to = 1.7976931348623157E308) longitude: Double)

Properties

Link copied to clipboard
@SerializedName(value = "lat")
val latitude: Double
Link copied to clipboard
@SerializedName(value = "lng")
val longitude: Double

Functions

Link copied to clipboard
fun distanceTo(other: LatLng): Double

Calculate distance between two points

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Extension method to convert a LatLng into a Point Geometry.

Link copied to clipboard

Convert to a simple String format that is usable as a REST API Parameter (e.g LatLng(42.123, 1.23) will become "42.123,1.23")

Link copied to clipboard
fun wrap(): LatLng

Return a new LatLng object with a wrapped Longitude. This allows original data object to remain unchanged.