W3cubDocs

/Web APIs

GeolocationPosition

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

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.

Instance properties

The GeolocationPosition interface doesn't inherit any properties.

GeolocationPosition.coords Read only Secure context

Returns a GeolocationCoordinates object defining the current location.

GeolocationPosition.timestamp Read only Secure context

Returns a timestamp, given as Unix time in milliseconds, representing the time at which the location was retrieved.

Instance methods

The GeolocationPosition interface neither implements, nor inherits any methods.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
GeolocationPosition 795–78 7912–79 723.5–71 9 16 13.15–13.1 79≤37–78 7918–78 794–79 16 13.4≤3–13.4 12.01.0–12.0
coords 5 12 3.5 9 16 5 ≤37 18 4 16 ≤3 1.0
secure_context_required 47 ≤18 55 No 34 10 47 47 55 34 10 5.0
timestamp 5 12 3.5 9 16 5 ≤37 18 4 16 ≤3 1.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPosition