/ui/layers/view
The module exports a method to create layer.view elements.
- Source
Methods
(inner) changeEnd(layer)
The changeEnd method is assigned to the mapview.Map changeEnd event listener for layer with a tables object.
Layer with a tables object maybe zoom restricted.
The layer.tableCurrent() method is called to determine whether the layer has a table configured for the current zoom level.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer. |
Name | Type | Description |
---|---|---|
layer.view | HTMLElement | The layer view element. |
layer.displayToggle | HTMLElement | A button element which toggles the layer.display. |
layer.zoomBtn | HTMLElement | A button element which sets the mapview into the visible zoom range for the layer. |
- Source
(inner) layerView(layer) → {layer}
The layerView method will create and assign a layer.view node to the layer object.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer. |
Name | Type | Description |
---|---|---|
layer.view | Object | No layer view will be created with the view property null. |
layer.drawer | Object | The layer view will not be in a drawer element with the drawer property null. |
- Source
The layer object is returned after the layer view has been created.
- Type:
- layer
(inner) viewConfig(layer)
The viewConfig method will create viewConfig object and update the configuration from legacy properties.
The method will iterate through the panelOrder keys to add panel to the content array.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer. |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layer.viewConfig | Object | <optional> | Control options for elements in the layer.view. | |
viewConfig.displayToggle | Boolean | <optional> | true | Controls whether the layer toggle close is displayed. |
viewConfig.zoomBtn | Boolean | <optional> | true | Controls whether the zoom magnifying glas is displayed. |
layer.zoomBtn | Boolean | <optional> | Legacy property for viewConfig.zoomBtn. | |
layer.tables | Array | <optional> | Array of data tables for different zoom level. | |
viewConfig.zoomToExtentBtn | Boolean | <optional> | true | Controls whether the zoom to extent button is displayed. |
viewConfig.panelOrder | Array | <optional> | ['draw-drawer', 'dataviews-drawer', 'filter-drawer', 'style-drawer', 'meta'] | Controls which panels are added to the view and in which order, will be assigned from layer.panelOrder if not explicit. |
layer.panelOrder | Array | <optional> | Legacy configuration for viewConfig.panelOrder. | |
viewConfig.classList | string | <optional> | Classlist string to be added to layer-view drawer element classList. | |
layer.classList | string | <optional> | Legacy property for viewConfig.classList. |
- Source
(inner) zoomToRange(layer)
The zoomToRange method set layer.mapview zoom to be in range of the layer.tables configuration and calls the layer.show() method.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer. |
Name | Type | Description |
---|---|---|
layer.tables | Object | The zoom range table configuration. |
- Source