Skip to main content

Settings

Everything the app remembers between visits.

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

Signature​

import type { Settings } from "@mapcairn/core";

interface Settings

Properties​

basemapId​

readonly basemapId: string | null;

The id of the basemap the person chose, or null when they never have. With null the basemap is the host's default for the theme shown (see BasemapCatalogue), and it changes when the theme does. A chosen id is kept across theme changes and reloads. Nothing writes an id until a person picks a basemap, so a stored id, even the default's, is a choice. A shared link's basemap is not stored here.

language​

readonly language: string | null;

The BCP 47 tag of the language the person chose (for example "af"), or null to follow the browser's languages. A tag the host does not offer is ignored when the language is resolved. It lives on the device and is not part of a shared link.

lastView​

readonly lastView: ViewState | null;

The view the map had when it was last left, or null when there is none.

projection​

readonly projection: MapProjection;

The shape of the map: "flat" (the default) or "globe".

theme​

readonly theme: ThemeChoice;

The theme the person chose.

tourSeen​

readonly tourSeen: number | null;

The version of the first-visit tour the person has answered (taken, skipped, or made unnecessary by turning a layer on), or null for a new visitor. A host that bumps its tour version offers the tour once more.

units​

readonly units: UnitSystem;

Whether distances are shown in metric or imperial units.

zoomButtons​

readonly zoomButtons: boolean | null;

Whether to show zoom buttons. null means "use the device default": on for fine pointers, off for touch. An explicit true shows them on every device and never hides them.

See also​

Source: packages/core/src/ports/settings.ts:16