GeolocationPosition

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

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.

特性

GeolocationPosition interface doesn't inherit any properties .

GeolocationPosition.coords 只读 Secure context
返回 GeolocationCoordinates object defining the current location.
GeolocationPosition.timestamp 只读 Secure context
返回 DOMTimeStamp representing the time at which the location was retrieved.

方法

GeolocationPosition interface neither implements, nor inherits any methods.

规范

规范 状态 Comment
地理位置 API
The definition of 'GeolocationPosition' in that specification.
Recommendation Initial specification.

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GeolocationPosition Chrome 79
79
不支持 5 — 78
Alternate Name
Alternate Name Uses the non-standard name: Position
Edge 79
79
不支持 12 — 79
Alternate Name
Alternate Name Uses the non-standard name: Position
Firefox 72
72
不支持 3.5 — 71
Alternate Name
Alternate Name Uses the non-standard name: Position
IE 9
Alternate Name
9
Alternate Name
Alternate Name Uses the non-standard name: Position
Opera 16
Alternate Name
16
Alternate Name
Alternate Name Uses the non-standard name: Position
Safari 5
Alternate Name
5
Alternate Name
Alternate Name Uses the non-standard name: Position
WebView Android 79
79
不支持 ? — 78
Alternate Name
Alternate Name Uses the non-standard name: Position
Chrome Android 79
79
不支持 18 — 78
Alternate Name
Alternate Name Uses the non-standard name: Position
Firefox Android 4
Alternate Name
4
Alternate Name
Alternate Name Uses the non-standard name: Position
Opera Android 16
Alternate Name
16
Alternate Name
Alternate Name Uses the non-standard name: Position
Safari iOS Yes
Alternate Name
Yes
Alternate Name
Alternate Name Uses the non-standard name: Position
Samsung Internet Android 12.0
12.0
不支持 1.0 — 12.0
Alternate Name
Alternate Name Uses the non-standard name: Position
coords Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16 Safari 5 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 16 Safari iOS Yes Samsung Internet Android 1.0
Secure context required Chrome 47 Edge ≤18 Firefox 55 IE No Opera Yes Safari Yes WebView Android 47 Chrome Android 47 Firefox Android 55 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
timestamp Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16 Safari 5 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 16 Safari iOS Yes Samsung Internet Android 1.0

图例

完整支持
完整支持
不支持
不支持
使用非标名称。

另请参阅