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.

speed

Summary

Denotes the magnitude of the horizontal component of the hosting device’s current velocity specified in meters per second. If the implementation cannot provide speed information, the value of this attribute must be null. Otherwise, the value of this attribute must be a non-negative real number.

Property of apis/geolocation/Coordinatesapis/geolocation/Coordinates

Syntax

Note: This property is read-only.

var result = Coordinates.speed;

Return Value

Returns an object of type NumberNumber

Examples

if (position.coords.speed > 0) {
   // moving
   } else {
   // not moving
   }

Related specifications

W3C Geolocation Specification
W3C Editor’s Draft

Attributions