Read a complete position
A successful Geolocation API result contains more than latitude and longitude. This sample displays the values that are available on the device.
What you will learn
- How to read properties from
position.coords - Why some values may be
null - How to show a useful error message
- Latitude
- -
- Longitude
- -
- Accuracy
- -
- Altitude
- -
- Heading
- -
Accuracy is an estimate in meters. Altitude and heading are not available on every device, so design the interface to accept missing values.