Enum Class GeolocationAvailability

java.lang.Object
java.lang.Enum<GeolocationAvailability>
com.vaadin.flow.component.geolocation.GeolocationAvailability
All Implemented Interfaces:
Serializable, Comparable<GeolocationAvailability>, Constable

public enum GeolocationAvailability extends Enum<GeolocationAvailability>
Whether the browser can read the user's location right now, and if so what permission state the origin has.

Returned by Geolocation.availabilitySignal(). Reading the value does not show a permission dialog — it reports whether a dialog would appear on the next Geolocation.get(com.vaadin.flow.function.SerializableConsumer<com.vaadin.flow.component.geolocation.GeolocationPosition>, com.vaadin.flow.function.SerializableConsumer<com.vaadin.flow.component.geolocation.GeolocationError>) or Geolocation.track(com.vaadin.flow.component.Component) call, or whether the call would fail regardless because the feature is unusable in this context.

Typical usage:

  • UNSUPPORTED — hide the location control entirely; no user action can change this.
  • DENIED — pre-explain to the user why location is blocked and how to re-enable it in the browser settings.
  • GRANTED — safe to auto-fetch silently on return visits.
  • PROMPT / UNKNOWN — wait for an explicit user action (click a button) before triggering a browser prompt.