keyboard_backspace wifi_off
wifi_off

Your device is currently offline.
Geolocation will not work.

Geolocation

This feature is not (yet) supported on your device

The <geolocation> element is not (yet) supported on your device, the Geolocation API will be used.

The Geolocation API enables users to share their location with a web app. Below you will see your current location on a Google Map.

In supporting browsers, the <geolocation> element will be shown, which users can click to share their location. When access was previously blocked, users can simply click the buttons again to regain access as opposed to having to go through the browser's permission settings, which is the case when using the Geolocation API.

Demo

Code

<geolocation autolocate watch accuracymode="precise"></geolocation> // Geolocation API navigator.geolocation.getCurrentPosition(({coords}) => { const {latitude, longitude} = coords; showPosition(latitude, longitude); }, console.log(err), ); // geolocation element const geolocation = document.querySelector('geolocation'); geolocation.addEventListener('position', () => { const {latitude, longitude} = geolocation.position.coords; showPosition(latitude, longitude); });

Documentation

Geolocation API on MDN

<geolocation> element on MDN

Browser support

Geolocation API on caniuse.com

<geolocation> element on caniuse.com

What PWA Can Do Today A showcase of what is possible with Progressive Web Apps today