This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

altitude

Summary

Denotes the height of the position, specified in meters above the ellipsoid. If the implementation cannot provide altitude information, the value of this attribute must be null.

Property of apis/geolocation/Coordinatesapis/geolocation/Coordinates

Syntax

Note: This property is read-only.

var result = Coordinates.altitude;

Return Value

Returns an object of type NumberNumber

Examples

if (position.coords.altitude <= 2) {
   // at ground level
   } else {
   // above ground level
   }

Related specifications

W3C Geolocation Specification
W3C Editor’s Draft

Attributions