The Geolocation API exists on the global navigator object via navigator.geolocation.
Following methods are available in navigator.geolocation :
- getCurrentPosition allows us to request a user’s location any time.
- watchPosition is similar to getCurrentPosition. The only difference is that it will be called whenever the user’s location updates.
- clearWatch tells the device that app no longer needs location information.