/ui/layers/listview
The module exports the default listview method.
- Source
Requires
- module:/mapp/ui/layers/view
Methods
(inner) add(layer)
The add method creates a layer.view and adds this to the listview.
Name | Type | Description |
---|---|---|
layer | layer | The layer object to add |
Name | Type | Attributes | Description |
---|---|---|---|
layer.hidden | boolean | <optional> | Do not create a layer.view and shortcircuit. |
layer.group | string | <optional> | Create a layer group and or add the layer to an existing listview.group |
- Source
- event:addLayerView
(inner) addLayer(layer)
Adds a layer to group [this].
Name | Type | Description |
---|---|---|
layer | layer | Layer to add to the group |
- Source
(inner) chkVisibleLayer()
Checks if any layers in group are visible and toggles visibility button accordingly
- Source
(inner) createGroup(layer)
Name | Type | Description |
---|---|---|
layer | layer | The layer to add to a group. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.group | string | Group key. | |
layer.groupClassList | string | <optional> | CSS classes to apply to group |
layer.groupmeta | string | <optional> | HTML content for group metadata |
- Source
(inner) listview(params)
Creates a listview for organizing and displaying map layers, optionally grouped.
A HTMLelement target property must be provided for the listview element to be rendered into.
An initial list of decorated mapview layers is optional since layers can be added to the listview object through the add method.
The listview method is a decorator which returns the decorated listview object.
mapp.ui.layers.listview({
layers: mapview.layers,
target: document.getElementById('layer-list')
});
Name | Type | Description |
---|---|---|
params | Object | Configuration parameters |
Name | Type | Attributes | Description |
---|---|---|---|
params.target | HTMLElement | DOM element where the listview will be rendered | |
params.layers | Object | <optional> | Map of layer objects to be added to the listview |
- Source