Expand description
Geolocation manager — cross-platform state for the GPS/location surface (SUPER_PLAN_2 §1.5 + research/04 §3 + research/08 §6).
Three callers drive it:
-
The layout pass scans the styled DOM for
GeolocationProbeNodeTypes. When the first probe appears the framework firesPermissionDiffEvent::Subscribe(Capability::Geolocation)and the platform backend starts a nativeCLLocationManager/LocationManager/geocluesubscription. The reverse on the last probe leaving. -
The platform backend (
dll/src/desktop/extra/geolocation/<plat>.rs) callsset_latest_fix(...)whenever the native subscription delivers an update. The manager debounces and records the most recent value; callbacks read it viaCallbackInfo::get_geolocation_fix. -
Callbacks read
latest_fix()synchronously to render the map centre, decide whether to show “acquiring signal…”, etc.
No platform deps; no_std-friendly via alloc::collections::BTreeMap.
Structs§
- Geolocation
Manager - Cross-platform geolocation state. One per
App(the OS gives us a single per-process subscription, not per-window). - Geolocation
Probe Config - Configuration the user attaches to a
NodeType::GeolocationProbeto tune the platform subscription. Maps to W3CPositionOptions(enableHighAccuracy+maximumAge+timeout). - Location
Fix - One GPS / network-located fix. Mirrors the W3C
GeolocationPositionshape so the future web backend lands without API churn.
Enums§
- Geolocation
Diff Event - Diff event the layout pass emits when a probe appears or disappears.
Symmetric to
PermissionDiffEvent— drives the platform backend’s native subscribe / release calls.
Functions§
- drain_
location_ fixes - Drain every fix parked by
push_location_fix, in arrival order. Called once per layout pass; the caller applies them throughGeolocationManager::set_latest_fix(the last one wins). - push_
location_ fix - Park a location fix delivered by a platform backend (in the dll). Thread-safe; recovers from a poisoned lock so one panicking applier can’t wedge delivery forever.