Package com.vaadin.flow.component.geolocation


@NullMarked package com.vaadin.flow.component.geolocation
Server-side access to the browser's Geolocation API for reading the user's location.

Geolocation.getPosition(...) reads the location once; Geolocation.watchPosition(...) returns a GeolocationWatcher that delivers continuous updates (as a listener or a reactive signal) and stops automatically when its owning component is detached. Geolocation.availabilityHintSignal() gives a best-effort hint about whether permission has been granted, so you can decide whether to prompt the user.

Geolocation requires a secure context (HTTPS or localhost) and explicit user permission; the first request shows the browser's permission prompt, and a denied or unavailable request reports a GeolocationError. Accuracy varies by device, and fields such as altitude and speed may be absent when the device cannot measure them.