New to KendoReact? Start a free 30-day trial
Represents a geographic location.
| Name | Type | Default | Description |
|---|
|
|
number
|
|
|
|
number
|
|
(lat: number, lng: number)
Creates a new Location.
number
The location latitude in decimal degrees.
number
The location longitude in decimal degrees.
|
|
|---|
|
Creates a new instance with the same coordinates.
|
| Returns | |
|---|
Location
|
The new Location instance.
|
|
|
|
|---|
|
Finds a destination at the given distance and bearing from this location.
|
| Parameters | | |
|---|
|
distance
|
number
|
The distance to the destination in meters.
| |
bearing
|
number
|
The initial bearing to the destination in decimal degrees.
|
|
| Returns | |
|---|
Location
|
The destination at the given distance and bearing.
|
|
|
|
|---|
|
Calculates the great-circle distance to the given destination in meters.
|
| Parameters | | |
|---|
|
destination
|
Location
|
The destination location.
|
|
| Returns | |
|---|
number
|
The distance to the specified location in meters.
|
|
|
|
|---|
|
Compares this location with another instance.
|
| Parameters | | |
|---|
|
location
|
Location
|
The location to compare with.
|
|
| Returns | |
|---|
boolean
|
true if the location coordinates match; false otherwise.
|
|
|
|
|---|
|
Creates a Location instance from an [latitude, longitude] array.
|
| Parameters | | |
|---|
|
latlng
|
number[] | [number, number]
|
The [latitude, longitude] array.
|
|
|
|
|
|
|---|
|
Creates a Location instance from an [longitude, latitude] array.
|
| Parameters | | |
|---|
|
lnglat
|
number[] | [number, number]
|
The [longitude, latitude] array.
|
|
|
|
|
|
|---|
|
Rounds the location coordinates to the specified number of fractional digits.
|
| Parameters | | |
|---|
|
digits
|
number
|
Number of fractional digits.
|
|
| Returns | |
|---|
Location
|
The current Location instance.
|
|
|
|
|---|
|
Returns the location coordinates as an [lat, lng] array.
|
| Returns | |
|---|
[number, number]
|
An array representation of the location.
|
|
|
|
|---|
|
Returns the location coordinates formatted as '{lat},{lng}'.
|
| Returns | |
|---|
string
|
A string representation of the location.
|
|
|
|
|---|
|
Wraps the latitude and longitude to fit into the [0, 90] and [0, 180] range.
|
| Returns | |
|---|
Location
|
The current Location instance.
|
|