Installation
Universal Layer Manager consists of a core library @ulm/core and adapters for specific map libraries. Install the core package, then add an adapter for the map library you are using.
Core
npm install @ulm/corepnpm add @ulm/coreyarn add @ulm/coreDates for time info
You only need this if your layers carry time info. Dates are Temporal values, and not every browser supports Temporal yet, so install the polyfill as well:
npm install temporal-polyfillpnpm add temporal-polyfillyarn add temporal-polyfillThen import Temporal from it wherever you create dates:
import { Temporal } from 'temporal-polyfill';The TypeScript types come with @ulm/core, so there is nothing else to install.
Adapters
Leaflet
npm install @ulm/leaflet leafletpnpm add @ulm/leaflet leafletyarn add @ulm/leaflet leafletIf you are using TypeScript, also install @types/leaflet.
MapLibre
npm install @ulm/maplibre maplibre-glpnpm add @ulm/maplibre maplibre-glyarn add @ulm/maplibre maplibre-glmaplibre-gl brings its own TypeScript types. The adapter needs maplibre-gl 6, and like it, is published as ES modules only.
ArcGIS
npm install @ulm/arcgis @arcgis/corepnpm add @ulm/arcgis @arcgis/coreyarn add @ulm/arcgis @arcgis/core@arcgis/core brings its own TypeScript types. The adapter needs @arcgis/core 5, and like it, is published as ES modules only.
OpenLayers
npm install @ulm/openlayers olpnpm add @ulm/openlayers olyarn add @ulm/openlayers olol brings its own TypeScript types. The adapter needs ol 10, and like it, is published as ES modules only.
Other map libraries
For other map libraries, you can write your own adapter.
From a local clone
To run the examples or contribute, clone the repository and build it:
git clone https://github.com/antarctica/universal-layer-manager.git
cd universal-layer-manager
npm install
npm run build
npm run dev # start the examples