# MapCairnOptions

What a map is mounted with, besides its element. Every option is optional.

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

## Signature

```ts
import type { MapCairnOptions } from "@mapcairn/map";
 
interface MapCairnOptions
```

## Properties

### about

```ts
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

```ts
readonly basemap?: string;
```

The id of the basemap to start on when neither the shared link nor the
saved choice names one on offer. The default of the basemaps, for the
theme, when left out. A later change applies to the map that is showing,
over the link and the saved choice, until the person picks another.

### basemaps

```ts
readonly basemaps?: readonly BasemapDefinition[];
```

The basemaps offered, as plain definitions. When left out, those the
services offer, or else the SDK's built-in basemaps.

### creditsLink

```ts
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

```ts
readonly engineNotice?: MountEngineNotice;
```

The notice for a map that cannot run. None when left out. In releases after `0.2.0`, not in `0.2.0` or any earlier release.

### label

```ts
readonly label?: string;
```

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

### language

```ts
readonly language?: string;
```

The tag of the language to start on: one the page offers, or `"en-GB"`
when it offers none. Left as the settings have it when left out.

### languages

```ts
readonly languages?: readonly MountLanguage[];
```

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

### layers

```ts
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

```ts
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.

### messageStore

```ts
readonly messageStore?: MessageStore;
```

The message store the page made with `createMessageStore` from the same
`services`, and keeps for its own pages: the map reads the language from it
in place of making one of its own, so the page and the map are always in one
language, and the Try again of a language that failed to load asks the
page's store, which the page's `lang` follows. The map does not hand the
store its services: the page does, as it does for its own pages. Left out,
the map makes its own. In releases after `0.2.0`, not in `0.2.0` or any
earlier release.

### notes

```ts
readonly notes?: MountNotes;
```

Notes in the page's words. See [`MountNotes`](https://docs.mapcairn.com/api/map/MountNotes.md). Setting them draws the map again. In releases after `0.2.0`, not in `0.2.0` or any earlier release.

### privacyHref

```ts
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

```ts
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

```ts
readonly services?: Partial<Services>;
```

The services, whole or in part, that the definition's defaults build on,
as a plain object. What the defaults say these offer as a catalogue cannot
also be given as `basemaps`, `layers` or `languages`. For `map`'s own
definition they must be the whole of `Services`, and of layer catalogues
only `emptyLayerCatalogue` itself counts as none.

### theme

```ts
readonly theme?: ThemeChoice;
```

The theme choice to write to the settings. Left as the definition's defaults have it when left out.

### tools

```ts
readonly tools?: readonly MapTool[];
```

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

### tour

```ts
readonly tour?: MountTour;
```

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

### view

```ts
readonly view?: ViewState;
```

The view to start on when neither the shared link `services.url` reads nor
a saved `lastView` has one. A view of the whole world when left out.

## See also

- [`MountAbout`](https://docs.mapcairn.com/api/map/MountAbout.md)
- [`BasemapDefinition`](https://docs.mapcairn.com/api/core/BasemapDefinition.md)
- [`MountLink`](https://docs.mapcairn.com/api/map/MountLink.md)
- [`MountEngineNotice`](https://docs.mapcairn.com/api/map/MountEngineNotice.md)
- [`MountLanguage`](https://docs.mapcairn.com/api/map/MountLanguage.md)
- [`LayerDefinition`](https://docs.mapcairn.com/api/core/LayerDefinition.md)
- [`MessageStore`](https://docs.mapcairn.com/api/core/MessageStore.md)
- [`MountNotes`](https://docs.mapcairn.com/api/map/MountNotes.md)
- [`Services`](https://docs.mapcairn.com/api/core/Services.md)
- [`ThemeChoice`](https://docs.mapcairn.com/api/core/ThemeChoice.md)
- [`MapTool`](https://docs.mapcairn.com/api/map/MapTool.md)
- [`MountTour`](https://docs.mapcairn.com/api/map/MountTour.md)
- [`ViewState`](https://docs.mapcairn.com/api/core/ViewState.md)

Source: [packages/map/src/element/types.ts:167](https://github.com/MapCairn/mapcairn/blob/main/packages/map/src/element/types.ts#L167)
