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
Microsoft Developer Network: Windows Internet Explorer API reference Article