Skip to content

geospatial-sdk / legend/lib / createLegendFromLayer

createLegendFromLayer()

ts
function createLegendFromLayer(layer, options?): Promise<HTMLElement | null>

Creates a legend from a layer.

Parameters

layer: MapContextLayer

The layer to create the legend from.

options?: LegendOptions = {}

The options to create the legend.

Returns

Promise<HTMLElement | null>

A promise that resolves to the legend element or null if the legend could not be created.

Defined in

packages/legend/lib/create-legend/from-layer.ts:91