Skip to content

📦 legend ​

This package provides utilities to automatically create map legends from layer definitions in a Map Context.

Installation ​

sh
npm install @geospatial-sdk/legend

Usage ​

typescript
import { createLegendFromLayer } from "@geospatial-sdk/legend";

const layer = {
  type: "wms",
  url: "https://example.com/wms",
  name: "test-layer",
};

createLegendFromLayer(layer).then((legendDiv) => {
  document.body.appendChild(legendDiv);
});

Functions ​

FunctionDescription
createLegendFromLayerCreates a legend from a layer.