/ui/layers/legends/categorized

The categorized theme legend module exports the categorizedTheme to the ui.layers.legend{} library object.

Requires

Methods

(inner) categorizedTheme(layer) → {HTMLElement}

The categorizedTheme method creates and returns a categorized theme legend for the current layer.style.theme.

The legend of a theme with a data distribution is not created until the distribution has been processed from the layer data. The legend would otherwise create the icons for every category in the theme configuration, which may be thousands of categories not present in the data. The check is made here rather than only in the drawLegend method, since a legend method may be called directly, eg. from a plugin.

Parameters:
NameTypeDescription
layerlayer

The decorated mapp layer.

Returns:

The categorized theme legend element.

Type: 
HTMLElement