/ui/elements/layerStyle
The module exports an object of methods to for the creation of layer style elements.
- Source
Requires
Methods
(inner) hover(layer) → {HTMLElement}
The hover() style element method will return a checkbox to toggle the display of the current hover.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Description |
---|---|---|
layer.style | layer-style | The layer style configuration. |
style.hover | Object | The current hover. |
hover.hidden | Boolean | Whether a checkbox should be returned. |
hover.display | Boolean | The state of the hover. |
A checkbox element to toggle the current hover.
- Type:
- HTMLElement
(inner) hovers(layer) → {HTMLElement}
The hovers() style element method will return a dropdown to change the current hover assigned to a layer.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Description |
---|---|---|
layer.style | layer-style | The layer style configuration. |
style.hover | Object | The current hover. |
style.hovers | Object | Object where each property represents a hover configuration. |
A dropdown element to switch the current hover.
- Type:
- HTMLElement
(inner) icon_scaling(layer) → {HTMLElement}
The icon_scaling() style element method will returns a contents array with controls for icon.scaling properties (field, icon, clusterScale, zoomInScale, and zoomOutScale).
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.style | layer-style | The layer style configuration. | |
style.icon_scaling | Object | The icon_scaling config. | |
icon_scaling.hidden | Boolean | Do not show icon_scaling controls in panel. | |
icon_scaling.field | String | <optional> | Assign field value as feature property for scaling point feature icons. |
icon_scaling.icon | Boolean | <optional> | Add control to alter the base icon scale. |
icon_scaling.clusterScale | Boolean | <optional> | Add control to alter the cluster.clusterScale value. |
icon_scaling.zoomInScale | Boolean | <optional> | Add control to alter the zoomInScale value. |
icon_scaling.zoomOutScale | Boolean | <optional> | Add control to alter the zoomOutScale value. |
- Type:
- HTMLElement
(inner) label(layer) → {HTMLElement}
The label() style element method will return a checkbox to toggle the display of the current label.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Description |
---|---|---|
layer.style | layer-style | The layer style configuration. |
style.label | Object | The current label. |
label.hidden | Boolean | Whether a checkbox should be returned. |
label.display | Boolean | The state of the label. |
A checkbox element to toggle the current label.
- Type:
- HTMLElement
(inner) labels(layer) → {HTMLElement}
The labels() style element method will return a dropdown to change the current label assigned to a layer.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Description |
---|---|---|
layer.style | layer-style | The layer style configuration. |
style.label | Object | The current label. |
style.labels | Object | Object where each property represents a label configuration. |
A dropdown element to switch the current label.
- Type:
- HTMLElement
(inner) panel(layer) → {HTMLElement}
The panel() style element method creates an array of style.elements from all available style property keys if not implicit.
The elements array will be mapped to return a flat array of HTMLElements as content for the layer.style.view node.
The layer.style.view is returned for the style drawer shown in the default mapp view layer.view.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.style | layer-style | The layer style configuration. | |
style.elements | Array | <optional> | Array of method keys to order elements in the layer.style.view. |
The layer.style.view element.
- Type:
- HTMLElement
(inner) theme(layer) → {HTMLElement}
The theme() style element method will returns a content array with elements for the theme meta text and legend.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.style | layer-style | The layer style configuration. | |
style.labels | Object | <optional> | Available label configurations. |
style.hovers | Object | <optional> | Availabel hover configurations. |
style.theme | Object | The current theme. | |
theme.title | string | <optional> | Theme title for legend. |
theme.meta | string | <optional> | Meta text to display. |
theme.setLabel | string | <optional> | Key for label from style.labels{} to assign. |
theme.setHover | string | <optional> | Key for hover from style.hovers{} to assign. |
- Type:
- HTMLElement
(inner) themes(layer) → {HTMLElement}
The themes() style element method will return a dropdown to change the current theme assigned to a layer.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer with a style object. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.style | layer-style | The layer style configuration. | |
style.theme | Object | The current theme. | |
style.themes | Object | Object where each property represents a theme. | |
style.label | Object | <optional> | The current label. |
style.hover | Object | <optional> | The current hover. |
A dropdown element to switch the current theme.
- Type:
- HTMLElement