Skip to main content

LayersSectionProps

Props for LayersSection.

This is an interface exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { LayersSectionProps } from "@mapcairn/map";

interface LayersSectionProps

Properties​

formatters​

readonly formatters?: FormatterRegistry;

The formatters card and list templates may name. Defaults to the built-ins.

headingLevel​

readonly headingLevel?: HeadingLevel;

The heading level. Defaults to 3, below the sheet's h2 title.

headingRef​

readonly headingRef?: Ref<HTMLHeadingElement>;

Receives the heading element, so the sheet can move focus to the section it opens on.

intro​

readonly intro?: string;

The line above the layers, in place of the catalogue's layers.intro ("Open data from public providers. Nothing is requested until you turn a layer on."), which is not true of every host (one behind a login serves its own data). An empty string leaves the line out.

layers​

readonly layers: DataLayers;

The layers state the section lists and changes.

onShowOnMap​

readonly onShowOnMap?: () => void;

Called after "Show on map" has centred a feature, so the host can make room for the map: the section keeps the feature clear of the sheet at REVEAL_DETENT, so the host should bring the sheet to that detent.

showTurnOffAll​

readonly showTurnOffAll?: boolean;

Whether the section offers "Turn off all layers", the action for each group and the Undo that follows. Defaults to true; a host that does not want them passes false.

See also​

Source: packages/map/src/layers/LayersSection.tsx:68