Home > @magiclane/maps-sdk > Coordinates > distance

Coordinates.distance() method

Calculate the distance in meters between two WGS84 coordinates.

Signature:

distance(other: Coordinates, input?: {
        ignoreAltitude?: boolean;
    }): number;

Parameters

Parameter

Type

Description

other

Coordinates

The other coordinates

{ ignoreAltitude }

(not declared)

(Optional)

input

{ ignoreAltitude?: boolean; }

(Optional)

Returns:

number

Distance in meters between current coordinates and the other parameter