GeolocationCoordinates

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

GeolocationCoordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated.

特性

GeolocationCoordinates interface doesn't inherit any properties .

GeolocationCoordinates.latitude 只读 Secure context
返回 double representing the position's latitude in decimal degrees.
GeolocationCoordinates.longitude 只读 Secure context
返回 double representing the position's longitude in decimal degrees.
GeolocationCoordinates.altitude 只读 Secure context
返回 double representing the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data.
GeolocationCoordinates.accuracy 只读 Secure context
返回 double representing the accuracy of the latitude and longitude properties, expressed in meters.
GeolocationCoordinates.altitudeAccuracy 只读 Secure context
返回 double representing the accuracy of the altitude expressed in meters. This value can be null .
GeolocationCoordinates.heading 只读 Secure context
返回 double representing the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If speed is 0 , heading is NaN . If the device is unable to provide heading information, this value is null .
GeolocationCoordinates.speed 只读 Secure context
返回 double representing the velocity of the device in meters per second. This value can be null .

方法

GeolocationCoordinates interface neither implements, nor inherits any method.

规范

规范 状态 Comment
地理位置 API
The definition of 'GeolocationCoordinates' 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
GeolocationCoordinates Chrome 79
79
不支持 5 — 78
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Edge 79
79
不支持 12 — 79
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Firefox 72
72
不支持 3.5 — 71
Alternate Name
Alternate Name Uses the non-standard name: 坐标
IE 9
Alternate Name
9
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Opera 16
Alternate Name
16
Alternate Name
Alternate Name Uses the non-standard name: 坐标
不支持 10.6 — 15
Safari 5
Alternate Name
5
Alternate Name
Alternate Name Uses the non-standard name: 坐标
WebView Android 79
79
不支持 ? — 78
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Chrome Android 79
79
不支持 18 — 78
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Firefox Android 4
Alternate Name
4
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Opera Android 16
16
不支持 11 — 14
Safari iOS 4.2
Alternate Name
4.2
Alternate Name
Alternate Name Uses the non-standard name: 坐标
Samsung Internet Android 1.0
Alternate Name
1.0
Alternate Name
Alternate Name Uses the non-standard name: 坐标
accuracy Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
altitude Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
altitudeAccuracy Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
heading Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
latitude Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
longitude Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0
Secure context required Chrome 47 Edge ≤79 Firefox 55 IE No Opera Yes Safari Yes WebView Android No Chrome Android 47 Firefox Android 55 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
speed Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16
16
不支持 10.6 — 15
Safari 5 WebView Android 37 Chrome Android 18 Firefox Android 4 Opera Android 16
16
不支持 11 — 14
Safari iOS ? Samsung Internet Android 1.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
使用非标名称。

另请参阅