此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

Position

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年7月.

* Some parts of this feature may have varying levels of support.

>

Position 介面表示在給定時間相關裝置的位置。這個位置用一個 Coordinates 物件表示,包括裝置在地球上的二維位置,以及裝置的海拔高度和速度。

屬性

Position 介面沒有繼承任何屬性

Position.coords Read only

回傳一個定義當前位置的 Coordinates 物件。

Position.timestamp Read only

回傳一個時間戳 DOMTimeStamp ,這個時間戳表示獲取到位置的時間。

方法

Position 介面沒有實作或繼承任何方法

規格

Specification
Geolocation>
# position_interface>

瀏覽器的相容性

請參考