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
sh
npm install @ulm/coresh
pnpm add @ulm/coresh
yarn 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:
sh
npm install temporal-polyfillsh
pnpm add temporal-polyfillsh
yarn add temporal-polyfillThen import Temporal from it wherever you create dates:
ts
import { Temporal } from 'temporal-polyfill';The TypeScript types come with @ulm/core, so there is nothing else to install.
Adapters
Leaflet
sh
npm install @ulm/leaflet leafletsh
pnpm add @ulm/leaflet leafletsh
yarn add @ulm/leaflet leafletIf you are using TypeScript, also install @types/leaflet.
Other map libraries
Leaflet is the only adapter we provide at the moment. 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:
sh
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