Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface GeolocationPosition

The GeolocationPosition interface represents the position of the concerned device at a given time. The position, represented by a GeolocationCoordinates object, comprehends the 2D position of the device, on a spheroid representing the Earth, but also its altitude and its speed. Available only in secure contexts.

MDN Reference

interface GeolocationPosition {
    coords: GeolocationCoordinates;
    timestamp: number;
    toJSON(): any;
}
Index

The coords read-only property of the GeolocationPosition interface returns a GeolocationCoordinates object representing a geographic position. It contains the location, that is longitude and latitude on the Earth, the altitude, and the speed of the object concerned, regrouped inside the returned value. It also contains accuracy information about these values.

MDN Reference

timestamp: number

The timestamp read-only property of the GeolocationPosition interface represents the date and time that the position was acquired by the device.

MDN Reference

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

    MDN Reference

    Returns any

Was this helpful?