GeolocationPosition: coords property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The coords
read-only property of the GeolocationPosition
interface returns a GeolocationCoordinates
object representing a geographic position. It contains the location, that is longitude and latitude on the Earth, the altitude, and the speed of the object concerned, regrouped inside the returned value. It also contains accuracy information about these values.
Value
A GeolocationCoordinates
object instance.
Specifications
Specification |
---|
Geolocation # coords-attribute |
Browser compatibility
BCD tables only load in the browser