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只读-
返回一个定义了当前位置的
Coordinates对象。 Position.timestamp只读-
返回一个时间戳
DOMTimeStamp,这个时间戳表示获取到的位置的时间。
方法
Position 接口没有实现也没有继承任何方法。
规范
| Specification |
|---|
| Geolocation> # position_interface> |
浏览器兼容性
Loading…
参阅
- 使用地理位置定位
- 使用它的
Geolocation接口。