v144 ยท dom

The <geolocation> element

Introduces the <geolocation> element, a declarative, user-activated control for accessing the user's location. It streamlines the user and developer journey by not only handling the permission flow but also directly providing location data to the site, often eliminating the need for a separate JavaScript API call.

concepts

  1. Geolocation Element

    A declarative <geolocation> element that requests and exposes the user's location without script. Click-to-share semantics built into the platform.

  2. Share-on-tap

    Tap the platform-styled element to share location โ€” the consent dialog comes from the browser, not script. Fallback uses navigator.geolocation.

  3. Checkout Fill

    The motivating address-form pattern: one tap of <geolocation autofill="city state postcode country"> populates every relevant input.

  4. Map Embed

    Get your coordinates from the Geolocation API and see a marker placed on an SVG world map. Shows latitude and longitude in both decimal and DMS format plus the accuracy circle radius.

why it shipped

The current web permission model for geolocation relies on JavaScript-triggered prompts, giving the user agent no strong signal of user intent. This results in out-of-context prompts, user frustration, and difficult-to-recover-from denial states.

references