accuracy
Summary
Denotes the accuracy level of the latitude and longitude coordinates. It is specified in meters and must be supported by all implementations. 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.accuracy;
Return Value
Returns an object of type NumberNumber
Examples
//Assuming the variable accuracy_threshold has been set
if (position.coords.accuracy < accuracy_threshold) {
// The position is relatively accurate.
} else {
// The position is potentially inaccurate.
}
Related specifications
- W3C Geolocation Specification
- W3C Editor’s Draft
Attributions
Microsoft Developer Network: Windows Internet Explorer API reference Article