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.

coords

Summary

Contains a set of geographic coordinates together with their associated accuracy, as well as a set of other optional attributes such as altitude and speed.

Property of apis/geolocation/Positionapis/geolocation/Position

Syntax

Note: This property is read-only.

var result = Position.coords;

Return Value

Returns an object of type

Coordinates

Examples

var poscoords = position.coords;
//Coordinates properties are now available
alert(poscoords.altitude);
alert(poscoords.heading);
//etc.

Related specifications

W3C Geolocation Specification
W3C Editor’s Draft

Attributions