Interface GeolocationResult

All Superinterfaces:
Serializable
All Known Implementing Classes:
GeolocationError, GeolocationPending, GeolocationPosition

public sealed interface GeolocationResult extends Serializable permits GeolocationPending (not exhaustive)
The value held by GeolocationWatcher.positionSignal() — a successful reading, an error, or the initial "waiting for first reading" state. Always exactly one of: The sealed hierarchy supports exhaustive pattern matching:
 switch (watcher.positionSignal().get()) {
 case GeolocationPending p -> showSpinner();
 case GeolocationPosition pos -> map.setCenter(pos.coords());
 case GeolocationError err -> showError(err.errorCode());
 }