Skip to main content

createStaticLayerCatalogue

A LayerCatalogue over definitions that are known when the app is built. It is ready on the first read, on the server and in the browser, and never changes. Each definition is validated against the decoders and formatters the host registers, so a broken definition fails when the app starts, with every problem named, rather than when someone turns the layer on.

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

Signature​

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

function createStaticLayerCatalogue(definitions: readonly LayerDefinition[], options: ValidationOptions): LayerCatalogue;

Parameters​

  • definitions (readonly LayerDefinition[])
  • options (ValidationOptions)

Returns​

LayerCatalogue

Throws​

  • An error listing every problem, each prefixed with its layer id. Use createRuntimeLayerCatalogue for definitions that can be wrong without stopping the app.

See also​

Source: packages/core/src/layers/staticLayerCatalogue.ts:20