/ui/layers/legends/utils
The categorized theme legend module exports the categorizedTheme to the ui.layers.legend{} library object.
Dictionary entries:
- layer_style_switch_caption
- layer_style_switch_all
- layer_style_cluster
Requires
Methods
(inner) catElement(cat, theme, layer) → {HTMLElement}
Create legend entry for category within a theme.
| Name | Type | Description |
|---|---|---|
cat | Object | The category object. |
theme | Object | The theme configuration object. |
layer | Object | The layer object. |
The cat element for the legend grid.
- Type:
- HTMLElement
(inner) catToggle(e, layer, cat)
The method toggles the disabled class on the event target element.
If toggled [on] the filterAdd method will be called and the style will be set to null.
If toggled [off] the filterRemove method will be called and the style will be restored from the cat._style.
| Name | Type | Description |
|---|---|---|
e | Event | The cat label click event. |
layer | layer | The decorated mapp layer. |
cat | object | The cat object from the theme. |
(inner) clusterLegend(layer) → {HTMLElement}
Adds a cluster icon for the theme.
| Name | Type | Description |
|---|---|---|
layer | The layer the theme exists on. |
The cat element for the legend grid.
- Type:
- HTMLElement
(async, inner) filterAdd(layer, cat)
Add the cat value to the current filter.
| Name | Type | Description |
|---|---|---|
layer | layer | The decorated mapp layer. |
cat | object | The cat object from the theme. |
(async, inner) filterRemove(layer, cat)
Remove the cat value to the current filter.
| Name | Type | Description |
|---|---|---|
layer | layer | The decorated mapp layer. |
cat | object | The cat object from the theme. |
(inner) renderLegend(layer, node)
The method renders the theme legend node into the layer.style.legend node.
The layer.style.legend node is created by the layerStyle theme element and the drawLegend method will not call a legend method for a layer without a legend node. A legend method may however be called directly, eg. from a plugin or test. The theme legend node is assigned as layer.style.legend if the layer has no legend node to render into.
| Name | Type | Description |
|---|---|---|
layer | layer | The decorated mapp layer. |
node | HTMLElement | The theme legend node. |
| Name | Type | Attributes | Description |
|---|---|---|---|
layer.style.legend | HTMLElement | <optional> | The node into which the legend content is rendered. |
(inner) themeLegend(theme)
The method assigns theme.legend properties to control the layout through css classes.
| Name | Type | Description |
|---|---|---|
theme | object |
| Name | Type | Description |
|---|---|---|
theme.legend | object | The configuration for the theme legend. |
(inner) themeLegendSwitch() → {HTMLElement}
The method returns a HTMLElement with a button which toggles all label elements in the legend.
HTMLElement with nested button.
- Type:
- HTMLElement