MapChromeProps
Props for MapChrome.
This is an interface exported by @mapcairn/map, checked against version 0.2.0.
Signature
import type { MapChromeProps } from "@mapcairn/map";
interface MapChromeProps
Properties
background
readonly background: ReactNode;
The map, drawn full-bleed behind everything inside the main landmark.
bottomCentre
readonly bottomCentre?: ReactNode;
Measure toolbar, toasts and the tile-error banner.
bottomEnd
readonly bottomEnd?: ReactNode;
Attribution.
bottomStart
readonly bottomStart?: ReactNode;
Scale bar, cursor coordinates and zoom level (MapReadout).
endStack
readonly endStack?: ReactNode;
Compass, main control group and zoom group (EndStack).
mainLandmark
readonly mainLandmark?: boolean;
Whether the map is wrapped in the page's main landmark. Defaults to
true. Turn it off when the page has its own main or holds more than one
map, because a page has one main landmark; the map is then wrapped in a
plain element.
mapKey
readonly mapKey?: ReactNode;
The key to the layers that are on (MapKey). It sits above the scale
bar, rides above the sheet or beside the side panel with it, is as tall
as the room under the search pill allows, and hides when there is no room
for its chip, while the credits are open, and at the full detent. A
prop named key would be React's own, so it is mapKey.
modal
readonly modal: boolean;
True while the sheet is modal: everything but the sheet becomes inert.
onViewportChange
readonly onViewportChange?: (viewport: {
readonly width: number;
readonly height: number;
}) => void;
Called when the measured container size changes.
sheet
readonly sheet?: ReactNode;
The Sheet (bottom sheet or side panel). Rendered outside every inert
group, so it stays operable while the rest of the chrome is inert.
topStart
readonly topStart?: ReactNode;
Search pill.
tour
readonly tour?: ReactNode;
The first-visit tour card. It sits in the free space at the top of the map: under the search pill on a narrow screen, and between the search column and the end stack in the panel layout. It hides, like the bottom slots, while the sheet is at full, and while the bottom row, lifted above the sheet or a toolbar, would run into it.
tourSide
readonly tourSide?: "start" | "end";
In the panel layout, whether the tour card sits against the search
column and panel ("start", the default) or against the end stack.