Home > @magiclane/maps-sdk > Coordinates

Coordinates class

Coordinates class

Signature:

export declare class Coordinates 

Constructors

Constructor

Modifiers

Description

(constructor)({ latitude, longitude, altitude, horizontalAccuracy, verticalAccuracy, sceneObject, }, input)

Create a coordinates object from latitude, longitude and altitude.

Properties

Property

Modifiers

Type

Description

altitude?

number

(Optional) Altitude in meters.

It can be negative.

copy

readonly

Coordinates

Create a new coordinates object with the same properties as the original.

horizontalAccuracy?

number

(Optional) Horizontal accuracy of the location in meters.

isValid

readonly

boolean

Checks if the coordinates are valid

latitude

number

Latitude in degrees. Valid values -90.0 .. +90.00.

It is positive towards the north pole. Negative values are towards the south pole. At the Equator the value is 0.

longitude

number

Longitude in degrees. Valid values -180.0 .. +180.00.

It is positive towards the east. Negative values are towards the west. At the Greenwich meridian the value is 0.

sceneObject?

number

(Optional) Parent scene object to which coordinates belongs.

Scene object id.

verticalAccuracy?

number

(Optional) Vertical accuracy of the location in meters.

Methods

Method

Modifiers

Description

azimuth(target)

Calculates the azimuth (bearing) from this coordinate to target.

The azimuth is computed according to the ellipsoid model of WGS84 and returned in degrees. If the points are effectively identical or invalid, the method returns 0.0.

copyWithMetersOffset({ metersLatitude, metersLongitude, }, input)

Creates a new coordinates object with the given meters offset

distance(other, { ignoreAltitude }, input)

Calculate the distance in meters between two WGS84 coordinates.

equals(other)

fromJson(json)

static

fromLatLong(latitude, longitude, altitude)

static

Create a coordinates object from latitude, longitude and optional altitude.

toJson()

toString()