Controls and panels
MapControls is the floating stack over the map. Zoom, compass, layers and preferences show by default. The Props tab lists every control and prop.
Place the stack inside MapView, and switch controls on or off by name:
Children join the same stack, spacing and focus order. Leave openPanel unset and the stack opens its own panels. Set it to control them yourself:
Left unset, a control drives the map itself. Set an on* handler and yours runs instead:
DownloadControl and DirectionsControl require their onClick, because only your app knows what to open:
CompassRose is the needle CompassControl draws, for a compass of your own. StudioControls belongs to the studio chrome.
StreetViewControl is a handle the reader drags onto the map. The imagery is Google's, so it needs your Google Maps API key and the @googlemaps/js-api-loader package.
Five primitives make a control indistinguishable from the built-ins: ControlButton, ControlGroup, ControlTooltip, Glyph and OptionRow.
Icons, strings and colours come from the provider: see Customize the elements.
Three panels open from the stack. Each takes its options through a prop named after it:
The points-of-interest panel offers one water row, and the units start metric. Mount a panel on its own when it belongs in a sidebar or a settings drawer.
Weather overlays change with the hour. Draw the snow-depth overlay, and offersTime adds a time slider to the layers panel:
The map then draws the snow depth for the hour the reader picks. Back on now, it follows the clock again.