LatLng

A geographical location which contains a single latitude, longitude pair, with optional altitude.

Latitude and longitude are expressed as decimal degrees in the WGS84 datum. By default, altitude is 0.0, or sea level.

MapLibre GL displays maps in the Mercator Projection and projects geographical data automatically, so all data enters in the WGS84 datum.

Constructors

Link copied to clipboard
constructor()

Construct a new latitude, longitude point at (0, 0)

constructor(latitude: Double, longitude: Double)

Construct a new latitude, longitude point given double arguments

constructor(latitude: Double, longitude: Double, altitude: Double)

Construct a new latitude, longitude, altitude point given double arguments

constructor(location: Location)

Construct a new latitude, longitude, altitude point given location argument

constructor(latLng: LatLng)

Construct a new latitude, longitude, altitude point given another latitude, longitude, altitude point.

constructor(in: Parcel)

Constructs a new latitude, longitude, altitude tuple given a parcel.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The altitude, in meters.

Link copied to clipboard

The latitude, in degrees.

Link copied to clipboard

The longitude, in degrees.

Functions

Link copied to clipboard
open override fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

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

Indicates whether some other object is "equal to" this one.

Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code value for the object.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the object.

Link copied to clipboard
fun wrap(): LatLng

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

Link copied to clipboard
open override fun writeToParcel(out: Parcel, flags: Int)

Flatten this object in to a Parcel.