📦 maplibre ​
This package provides utilities to create and manage MapLibre GL JS maps using the declarative Map Context model from @geospatial-sdk/core.
Installation ​
sh
npm install @geospatial-sdk/maplibreUsage ​
typescript
import { createMapFromContext } from "@geospatial-sdk/maplibre";
import type { MapContext } from "@geospatial-sdk/core";
const mapContext: MapContext = {
layers: [
{
type: "xyz",
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
},
],
view: {
center: [6, 48.5],
zoom: 5,
},
};
const map = await createMapFromContext(
mapContext,
document.getElementById("map"),
);Interfaces ​
| Interface | Description |
|---|---|
| LayerMetadataSpecification | - |
Type Aliases ​
| Type Alias | Description |
|---|---|
| Dataset | - |
| LayerContextWithStyle | - |
| LayerSpecificationWithSource | - |
| PartialStyleSpecification | - |
Functions ​
| Function | Description |
|---|---|
| applyContextDiffToMap | Apply a context diff to an MapLibre map |
| createMapFromContext | Create a Maplibre map from a context; map options need to be provided |
| resetMapFromContext | Resets a Maplibre map from a context; existing content will be cleared |