GeolocationCoordinates
Baseline 廣泛可用 *
GeolocationCoordinates 介面表示裝置在地球上的位置和海拔高度,以及計算這些屬性的精度。地理位置資訊以世界大地測量系統座標 (WGS84) 的形式提供。
例項屬性
GeolocationCoordinates 介面不繼承任何屬性。
GeolocationCoordinates.latitude只讀-
返回一個
double,表示位置的緯度(以十進位制度數為單位)。 GeolocationCoordinates.longitude只讀-
返回一個
double,表示位置的經度(以十進位制度數為單位)。 GeolocationCoordinates.altitude只讀-
返回一個
double,表示位置的海拔高度(以米為單位),相對於標稱海平面。如果實現無法提供資料,則此值可能為null。 GeolocationCoordinates.accuracy只讀-
返回一個
double,表示latitude和longitude屬性的精度(以米為單位)。 GeolocationCoordinates.altitudeAccuracy只讀-
返回一個
double,表示altitude的精度(以米為單位)。如果實現無法提供資料,則此值可能為null。 GeolocationCoordinates.heading只讀-
返回一個
double,表示裝置朝向的方向。此值以度為單位,表示裝置偏離真北的角度。0度表示真北,方向按順時針確定(這意味著東方是90度,西方是270度)。如果speed為0或裝置無法提供heading資訊,則heading為null。 GeolocationCoordinates.speed只讀-
返回一個
double,表示裝置的速度(以米/秒為單位)。此值可能為null。
例項方法
GeolocationCoordinates 介面不繼承任何方法。
GeolocationCoordinates.toJSON()-
返回
GeolocationCoordinates物件的 JSON 表示形式,並支援使用JSON.stringify()進行序列化。
規範
| 規範 |
|---|
| Geolocation # coordinates_interface |
瀏覽器相容性
載入中…