Skip to main content

createBasemapCatalogue

Builds a BasemapCatalogue.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { createBasemapCatalogue } from "@mapcairn/core";

function createBasemapCatalogue(basemaps: readonly BasemapDefinition[], defaultId?: string | undefined, themeDefaultIds?: ThemeDefaultIds): BasemapCatalogue;

Parameters​

  • basemaps (readonly BasemapDefinition[]): At least one basemap, with unique ids.
  • defaultId? (string | undefined): The default basemap's id. Defaults to the first basemap.
  • themeDefaultIds? (ThemeDefaultIds): The basemap to show by default in each theme, for a host whose default follows the theme. A theme left out uses defaultId.

Returns​

BasemapCatalogue

Throws​

  • When the list is empty, repeats an id, or does not hold defaultId or a per-theme default.

See also​

Source: packages/core/src/basemaps/basemaps.ts:245