Access a user's geographical location with their permission.
The Geolocation API allows web applications to access a user's location, provided the user gives their consent. This is a powerful feature for location-aware applications, like mapping services, local search, or weather apps. The API is accessed through the `navigator.geolocation` object. The primary method is `getCurrentPosition()`. This method asynchronously attempts to obtain the device's current position. It takes up to three arguments: a success callback, an optional error callback, and an optional options object. If the user grants permission and the location is successfully determined, the success callback is invoked with a `Position` object. This object contains the coordinates (latitude and longitude), accuracy, and a timestamp. If the user denies permission or if the location cannot be determined, the error callback is invoked with an `Error` object explaining the reason. Because location access is a sensitive privacy issue, browsers will always prompt the user for permission before sharing this information with a website. It is also a requirement that the page is served over a secure context (HTTPS).