Skip to content

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 null when 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(); null on an author-constructed coordinate.

timestamp

  • Type: number | null
  • When the fix was taken, in seconds. Populated on a live fix; null on an author-constructed coordinate.

Instance Methods

distanceTo()

javascript
distanceTo(other: GeoCoordinate): number

Great-circle distance to another coordinate, in metres (haversine, 6371 km).

Parameters:

Returns: number

bearingTo()

javascript
bearingTo(other: GeoCoordinate): number

Initial great-circle bearing to another coordinate, in degrees (0–360, from north).

Parameters:

Returns: number