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
createRuntimeLayerCataloguefor definitions that can be wrong without stopping the app.