Coordinates
Coordinates
這個介面用來存取裝置的經緯度
,速度以及這些數值的準確度。
屬性
Coordinates
這個介面沒有繼承任何屬性。
Coordinates.latitude
Read only- 回傳一個十進位的 double 代表緯度。
Coordinates.longitude
Read only- 回傳一個十進位的 double 代表經度。
Coordinates.altitude
Read only- 回傳一個 double 代表距離海平面的高度,單位為公尺。如果無法提供這個值則回傳 null。
Coordinates.accuracy
Read only- 回傳一個 double 代表經緯度的精準值,單位為公尺。
Coordinates.altitudeAccuracy
Read only- 回傳一個 double 代表高度的精準度,單位為公尺。如果無法提供這個值則回傳 null。
Coordinates.heading
Read only- 回傳一個 double 代表裝置前進的方向,這個數值代表你偏離北方多少度,0度代表你向著正北方,照著順時針的方向遞增(90度代表正東方,270度代表正西方) 。如果速度值為0度,則此值為
NaN
。如果無法提供這個值則回傳 null。 Coordinates.speed
Read only- 回傳一個 double 代表速度,單位為公尺/秒。如果無法提供這個值則回傳 null。
方法
Coordinates
這個介面,沒有實作也沒有繼承自任何的方法。
規格
Specification | Status | Comment |
---|---|---|
Geolocation API The definition of 'Coordinates' in that specification. |
Recommendation | Initial specification. |
瀏覽器的相容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 5 | 3.5 (1.9.1) | 9 | 10.60 No support 15.0 16.0 |
5 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | ? | 4.0 (4) | ? | 10.60 | ? |
請參考
- Using geolocation
Geolocation
介面使用此物件。