Hooks
Every derivation an element performs is published as a hook. A surface composing its own layout reads the same projection the element does. Provider, camera, layers and search hooks ship from @mountaya/elements-react. The itinerary derivations ship from @mountaya/elements-react/elements, which brings no map canvas.
Read the provider
useMountayaMap() is null before the style loads, and when there is no map at all. Every control renders disabled until it resolves.
Track the camera
Each subscribes to one value and re-renders only on it. A compass reading the bearing does not re-render on pan. useCamera reports the whole pose.
Derive itinerary data
useWaypointCard is the headless half of the waypoint card: a surface drawing a place its own way gets the same facts in the same order.
useItineraryResource never throws. It returns an error alongside the data and calls onError, so a surface renders its own empty state.
Read the layers manifest
Overlays arrive in two shapes, and the split is the layers panel's whole logic. classicCategories hold children that replace one another; enrichmentCategories hold children that stack. localizedName from @mountaya/elements/i18n resolves an entry's name in the active language.
Run a search
useSearch runs the unified search and returns the row model. useSearchKeyboard wires arrow-key and enter handling over a result list. useDebouncedValue is the debounce those two use.