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.