On this page

Interface GeolocationCoordinates

The GeolocationCoordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. Available only in secure contexts.

MDN Reference

interface GeolocationCoordinates {
    accuracy: number;
    altitude: number | null;
    altitudeAccuracy: number | null;
    heading: number | null;
    latitude: number;
    longitude: number;
    speed: number | null;
    toJSON(): any;
}
Index

Properties

accuracy: number

The accuracy read-only property of the GeolocationCoordinates interface is a strictly positive double representing the accuracy, with a 95% confidence level, of the GeolocationCoordinates.latitude and GeolocationCoordinates.longitude properties expressed in meters.

MDN Reference

altitude: number | null

The altitude read-only property of the GeolocationCoordinates interface is a double representing the altitude of the position in meters above the WGS84 ellipsoid (which defines the nominal sea level surface).

MDN Reference

altitudeAccuracy: number | null

The altitudeAccuracy read-only property of the GeolocationCoordinates interface is a strictly positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters.

MDN Reference

heading: number | null

The heading read-only property of the GeolocationCoordinates interface is a double representing the direction in which the device is traveling.

MDN Reference

latitude: number

The latitude read-only property of the GeolocationCoordinates interface is a double representing the latitude of the position in decimal degrees.

MDN Reference

longitude: number

The longitude read-only property of the GeolocationCoordinates interface is a number which represents the longitude of a geographical position, specified in decimal degrees.

MDN Reference

speed: number | null

The speed read-only property of the GeolocationCoordinates interface is a double representing the velocity of the device in meters per second.

MDN Reference

Methods

  • The toJSON() method of the GeolocationCoordinates interface is a Serialization; it returns a JSON representation of the GeolocationCoordinates object.

    MDN Reference

    Returns any

Was this helpful?
SDK JS
Reference
GeolocationCoordinates