/ui/elements/layerStyle

The module exports an object of methods to for the creation of layer style elements.

Requires

Methods

(inner) hover(layer) → {HTMLElement}

The hover() style element method will return a checkbox to toggle the display of the current hover.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeDescription
layer.stylelayer-style

The layer style configuration.

style.hoverObject

The current hover.

hover.hiddenBoolean

Whether a checkbox should be returned.

hover.displayBoolean

The state of the hover.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeDescription
layer.stylelayer-style

The layer style configuration.

style.hoverObject

The current hover.

style.hoversObject

Object where each property represents a hover configuration.

Returns:

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).

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeAttributesDescription
layer.stylelayer-style

The layer style configuration.

style.icon_scalingObject

The icon_scaling config.

icon_scaling.hiddenBoolean

Do not show icon_scaling controls in panel.

icon_scaling.fieldString<optional>

Assign field value as feature property for scaling point feature icons.

icon_scaling.iconBoolean<optional>

Add control to alter the base icon scale.

icon_scaling.clusterScaleBoolean<optional>

Add control to alter the cluster.clusterScale value.

icon_scaling.zoomInScaleBoolean<optional>

Add control to alter the zoomInScale value.

icon_scaling.zoomOutScaleBoolean<optional>

Add control to alter the zoomOutScale value.

Returns:
with contents array of HTMLElements to control icon scaling.
Type: 
HTMLElement

(inner) label(layer) → {HTMLElement}

The label() style element method will return a checkbox to toggle the display of the current label.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeDescription
layer.stylelayer-style

The layer style configuration.

style.labelObject

The current label.

label.hiddenBoolean

Whether a checkbox should be returned.

label.displayBoolean

The state of the label.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeDescription
layer.stylelayer-style

The layer style configuration.

style.labelObject

The current label.

style.labelsObject

Object where each property represents a label configuration.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeAttributesDescription
layer.stylelayer-style

The layer style configuration.

style.elementsArray<optional>

Array of method keys to order elements in the layer.style.view.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeAttributesDescription
layer.stylelayer-style

The layer style configuration.

style.labelsObject<optional>

Available label configurations.

style.hoversObject<optional>

Availabel hover configurations.

style.themeObject

The current theme.

theme.titlestring<optional>

Theme title for legend.

theme.metastring<optional>

Meta text to display.

theme.setLabelstring<optional>

Key for label from style.labels{} to assign.

theme.setHoverstring<optional>

Key for hover from style.hovers{} to assign.

Returns:
with contents array for the theme meta and legend.
Type: 
HTMLElement

(inner) themes(layer) → {HTMLElement}

The themes() style element method will return a dropdown to change the current theme assigned to a layer.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer with a style object.

Properties
NameTypeAttributesDescription
layer.stylelayer-style

The layer style configuration.

style.themeObject

The current theme.

style.themesObject

Object where each property represents a theme.

style.labelObject<optional>

The current label.

style.hoverObject<optional>

The current hover.

Returns:

A dropdown element to switch the current theme.

Type: 
HTMLElement