/ui/layers/view

The module exports a method to create layer.view elements.

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer.

Properties
NameTypeDescription
layer.viewHTMLElement

The layer view element.

layer.displayToggleHTMLElement

A button element which toggles the layer.display.

layer.zoomBtnHTMLElement

A button element which sets the mapview into the visible zoom range for the layer.

(inner) layerView(layer) → {layer}

The layerView method will create and assign a layer.view node to the layer object.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer.

Properties
NameTypeDescription
layer.viewObject

No layer view will be created with the view property null.

layer.drawerObject

The layer view will not be in a drawer element with the drawer property null.

Returns:

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.

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer.

Properties
NameTypeAttributesDefaultDescription
layer.viewConfigObject<optional>

Control options for elements in the layer.view.

viewConfig.displayToggleBoolean<optional>
true

Controls whether the layer toggle close is displayed.

viewConfig.zoomBtnBoolean<optional>
true

Controls whether the zoom magnifying glas is displayed.

layer.zoomBtnBoolean<optional>

Legacy property for viewConfig.zoomBtn.

layer.tablesArray<optional>

Array of data tables for different zoom level.

viewConfig.zoomToExtentBtnBoolean<optional>
true

Controls whether the zoom to extent button is displayed.

viewConfig.panelOrderArray<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.panelOrderArray<optional>

Legacy configuration for viewConfig.panelOrder.

viewConfig.classListstring<optional>

Classlist string to be added to layer-view drawer element classList.

layer.classListstring<optional>

Legacy property for viewConfig.classList.

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

Parameters:
NameTypeDescription
layerlayer

A decorated mapp layer.

Properties
NameTypeDescription
layer.tablesObject

The zoom range table configuration.