此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

GeolocationCoordinates:altitude 属性

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月.

安全上下文: 此特性仅在一些支持的浏览器安全上下文(HTTPS)中可用。

GeolocationCoordinates 接口的 altitude 只读属性是一个 double 类型值,表示该位置相对于 WGS84 椭球体(它定义了名义上的海平面)的高度(单位为米)。如果实现无法提供该数据,则返回 null

一个 double 类型值,表示该位置相对于 WGS84 椭球体的高度(单位为米)。

规范

Specification
Geolocation
# altitude-and-altitudeaccuracy-attributes

浏览器兼容性

参见