Skip to main content

MountMapOptions

Everything mountMap takes. Every option is optional.

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

Signature​

import type { MountMapOptions } from "@mapcairn/sdk/browser";

interface MountMapOptions

Properties​

about​

readonly about?: MountAbout;

The About block in Help. None when left out. In releases after 0.2.0, not in 0.2.0 or any earlier release.

basemap​

readonly basemap?: string;

The id of the basemap to start on. The default of the basemaps, for the theme, when left out.

basemaps​

readonly basemaps?: readonly BasemapDefinition[];

The basemaps offered. The SDK's built-in basemaps when left out.

readonly creditsLink?: MountLink;

A link to the page's own About page, listed after the map credits. None when left out. In releases after 0.2.0, not in 0.2.0 or any earlier release.

engineNotice​

readonly engineNotice?: MountEngineNotice;

The notice for a map that cannot run, with the choice of a button that sends the noticeaction event, which the page must listen for. None when left out. In releases after 0.2.0, not in 0.2.0 or any earlier release.

label​

readonly label?: string;

The name of this map. Give each of several maps on a page its own.

language​

readonly language?: string;

The tag of the language to start on, from languages or "en-GB". The browser's choice when left out.

languages​

readonly languages?: readonly MountLanguage[];

Languages to offer besides English. The language switcher is in Settings.

layers​

readonly layers?: readonly LayerDefinition[] | (() => Promise<readonly LayerDefinition[]>);

The layers a person can turn on, as plain definitions or a function that loads them. The layers are listed in the Map options sheet, so name "map-options" in tools; without it they are not shown. Every layer starts off. A list is checked when the map is mounted, even when "map-options" is not named, and throws if it is not valid or if a layer in it needs services.layerSource (a feed, a query or a heatmap layer, or a tile layer with an identify block) and none was given. A tile or vector layer without an identify block never needs one. A function that fails, a layer it returns that is not valid and one that needs services.layerSource when there is none are reported through the error event, and the rest are kept.

mainLandmark​

readonly mainLandmark?: boolean;

Whether the map is wrapped in the page's main landmark. False when left out, because a page has one main landmark and usually has its own. In releases after 0.2.0, not in 0.2.0 or any earlier release.

notes​

readonly notes?: MountNotes;

Notes in the page's words, for what the map does not know. See MountNotes. In releases after 0.2.0, not in 0.2.0 or any earlier release.

privacyHref​

readonly privacyHref?: string;

Where the privacy policy is, shown as a link under Privacy in Settings: a path on the page's site (/privacy) or an http or https address. Any other address (javascript:, data:, //other.example) is a MountMapError naming this option. No link when left out or empty. In releases after 0.2.0, not in 0.2.0 or any earlier release.

regionId​

readonly regionId?: string;

The id of the map region, so a skip link the page drew before the map existed can point at it. Text without spaces. The region has no id when left out. The ids that link parts inside the map to each other are the map's own and are not affected. An id is unique in a page, so two maps, or a map and the page, must not share one, and an empty text is an error. In releases after 0.2.0, not in 0.2.0 or any earlier release.

services​

readonly services?: MountServices;

The providers the page writes.

theme​

readonly theme?: ThemeChoice;

"system" (when left out) follows the device.

tools​

readonly tools?: readonly MapTool[];

The tools to add. None when left out: zoom, the compass, the credits and the scale are always there.

tour​

readonly tour?: MountTour;

The first-visit tour. None when left out: the map then has no tour, and Help offers none. See MountTour. In releases after 0.2.0, not in 0.2.0 or any earlier release.

view​

readonly view?: ViewState;

The starting view. A view of the whole world when left out.

See also​

Source: packages/sdk/src/browser/types.ts:68