Location
Represents a geographic location.
Name | Type | Default | Description |
---|---|---|---|
lat |
|
The location latitude in decimal degrees. | |
lng |
|
The location longitude in decimal degrees. |
Constructors
Location
(lat: number, lng: number)
Creates a new Location.
Parameters
lat
number
The location latitude in decimal degrees.
lng
number
The location longitude in decimal degrees.
Methods
clone | ||||
---|---|---|---|---|
Creates a new instance with the same coordinates. | ||||
|
destination | |||||||||
---|---|---|---|---|---|---|---|---|---|
Finds a destination at the given distance and bearing from this location. | |||||||||
| |||||||||
|
distanceTo | ||||||
---|---|---|---|---|---|---|
Calculates the great-circle distance to the given destination in meters. | ||||||
| ||||||
|
equals | ||||||
---|---|---|---|---|---|---|
Compares this location with another instance. | ||||||
| ||||||
|
fromLatLng | ||||||
---|---|---|---|---|---|---|
Creates a Location instance from an [latitude, longitude] array. | ||||||
| ||||||
|
fromLngLat | ||||||
---|---|---|---|---|---|---|
Creates a Location instance from an [longitude, latitude] array. | ||||||
| ||||||
|
round | ||||||
---|---|---|---|---|---|---|
Rounds the location coordinates to the specified number of fractional digits. | ||||||
| ||||||
|
toArray | ||||
---|---|---|---|---|
Returns the location coordinates as an [lat, lng] array. | ||||
|
toString | ||||
---|---|---|---|---|
Returns the location coordinates formatted as '{lat},{lng}'. | ||||
|
wrap | ||||
---|---|---|---|---|
Wraps the latitude and longitude to fit into the [0, 90] and [0, 180] range. | ||||
|