Appearance
GeoCoordinate beta
A geographic coordinate. Construct one for a point of interest, or receive a live fix from environment.location.current() (which additionally populates horizontalAccuracy and timestamp).
Properties
latitude
- Type: number
- Degrees north (−90 to 90).
longitude
- Type: number
- Degrees east (−180 to 180).
altitude
- Type: number | null
- Metres above sea level, or
nullwhen not provided.
horizontalAccuracy
- Type: number | null
- Radius of horizontal uncertainty in metres – smaller is more accurate. Populated on a live fix from
environment.location.current();nullon an author-constructed coordinate.
timestamp
- Type: number | null
- When the fix was taken, in seconds. Populated on a live fix;
nullon an author-constructed coordinate.
Instance Methods
distanceTo()
javascript
distanceTo(other: GeoCoordinate): numberGreat-circle distance to another coordinate, in metres (haversine, 6371 km).
Parameters:
other(GeoCoordinate)
Returns: number
bearingTo()
javascript
bearingTo(other: GeoCoordinate): numberInitial great-circle bearing to another coordinate, in degrees (0–360, from north).
Parameters:
other(GeoCoordinate)
Returns: number