The Geolocation API can obtain information about the current geographic position of the user.
We get the geolocation feature via the navigator.geolocation property.
It returns a Geolocation object.
Its methods are described in the following table.
Name | Description | Returns |
---|---|---|
getCurrentPosition(callback, errorCallback, options) | Get the current position | void |
watchPosition(callback, error, options) | Start monitoring the current position | number |
clearWatch(id) | Stop monitoring the current position | void |