LatLng

open external class LatLng(latitude: Number, longitude: Number, altitude: Number = definedExternally)

Represents a geographical point with a certain latitude and longitude.

See https://leafletjs.com/reference.html#latlng

Constructors

Link copied to clipboard
constructor(latitude: Number, longitude: Number, altitude: Number = definedExternally)

Properties

Link copied to clipboard
open var alt: Number?

Altitude in meters

Link copied to clipboard
open var lat: Number

Latitude in degrees

Link copied to clipboard
open var lng: Number

Longitude in degrees

Functions

Link copied to clipboard
open fun distanceTo(otherLatLng: LatLng): Number

Returns the distance (in meters) to the given LatLng calculated using the Spherical Law of Cosines.

Link copied to clipboard
open fun equals(otherLatLng: LatLng): Boolean
open fun equals(otherLatLng: LatLng, maxMargin: Number = definedExternally): Boolean
Link copied to clipboard
open fun toBounds(sizeInMeters: Number): LatLngBounds

Returns a new LatLngBounds object in which each boundary is sizeInMeters/2 meters apart from the LatLng.

Link copied to clipboard
open fun wrap(): LatLng

Returns a new LatLng object with the longitude wrapped, so it's always between -180 and +180 degrees.