Geolocation API
Required for maps, location-based search, delivery tracking, geofencing, and any feature that needs the user's physical location. Understanding accuracy levels (GPS vs Wi-Fi vs IP) and the permission flow is essential.
What It Defines
Defines navigator.geolocation for obtaining device position: getCurrentPosition() and watchPosition() return GeolocationPosition with coords (latitude, longitude, altitude, accuracy, speed, heading) and timestamp. Requires secure context (HTTPS) and user permission.
Canonical (Normative)
Convenient (Practical)
Publishes web platform specs including CSS, accessibility, security policies, Service Workers, Web App Manifest, and many browser APIs. Also maintains some versioned HTML/DOM specs.
Related Specs
The gating mechanism for every sensitive browser API. Check permission state before requesting access to avoid unexpected prompt dialogs. The change event lets you react when users revoke permissions in browser settings.