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.

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 DOMTimeStamp representing the time at which the location was retrieved.

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
79
5-78
79
12-79
72
3.5-71
9
16
13.1
5-13.1
79
≤37-78
79
18-78
4
16
13.4
≤3-13.4
12.0
1.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
Yes
10
47
47
55
Yes
10
5.0
timestamp
5
12
3.5
9
16
5
≤37
18
4
16
≤3
1.0

See also

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