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

Properties

Link copied to clipboard

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.

Link copied to clipboard

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

Functions

Link copied to clipboard
fun toJSON(): JsAny

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