createLegendFromLayer() ​
createLegendFromLayer(
layer,options?):Promise<HTMLElement|null>
Creates a legend from a layer.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
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.