/ui/layers/panels/filter

The filter panel module exports the filterPanel method for the creation of a filter panel in the layer view.

Dictionary entries:

  • filter_header
  • filter_select
  • filter_clear_all
  • filter_reset_all
  • filter_btn_label
  • filter_btn_title
  • filter_count
  • filter_in_viewport
  • filter_not_in_viewport

Requires

Methods

(inner) filterDialog(layer)

The filterDialog method creates a button to toggle the filter dialog if configured.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.filterObject

The layer filter configuration.

filter.dialogObject<optional>

The configuration for the filter dialog.

dialog.btn_titleString<optional>

The title string for the filter dialog toggle button.

dialog.btn_labelString<optional>

The label string for the filter dialog toggle button.

dialog.showOnLayerDisplayObject<optional>

Show dialog in layer showCallback.

(inner) filterPanel(layer) → {HTMLElement}

The filterPanel method will call the multi_filter method to update the filter configuration in regards to the legacy multi_filter plugin.

The method will shortcircuit if the filter panel is set to be hidden or if the layer has no infoj entries to create a list of filter.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.infojArray

Array of infoj entries.

layer.filterObject

Configuration object for layer filter.

filter.hiddenBoolean<optional>

The filter panel should not be displayed.

Returns:

The filter panel drawer element or filter dialog button.

Type: 
HTMLElement

(inner) listFilter(layer) → {Array}

Parse layer.infoj entries to create a list of layer filter objects.

Any entry with a filter defintion will be included in the list unless specifically excluded in the layer.filter configuration.

A filter definition will be created for all entries if possible with the includeAll layer.filter flag or if the entry.field is in the layer.filter.include[] array.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.filterObject

Configuration object for layer filter.

filter.excludeArray<optional>

Array of filter [fields] which are excluded in the filter list.

filter.includeArray<optional>

Array of filter [fields] which should be included in the filter list.

filter.includeAllBoolean<optional>

Include all possible infoj entry in filter list.

Returns:

Array of cloned entry.filter

Type: 
Array

(inner) multi_filter()

Support for multi_filter legacy plugin and configuration. Warning will be issued if the multi_filter plugin is configured. The filter panel method will shortcircuit with the hidden flag set by the multi_filter plugin. The hidden flag property will be deleted with the multi_filter layer configuration but the plugin not loaded.

(inner) openDialog(layer)

Opens the filter panel in a dialog.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.filterObject

The configuration parameters of the filter on the layer.

(inner) reports(layer) → {HTMLElement}

Creates a list of a elements containing links to custom views.

Specifying layer.reports.drawer: false will prevent a drawer from being made for the reports panel.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.reportsArray

The configuration of the reports

Returns:

The report element for the panel.

Type: 
HTMLElement

(inner) updatePanel(layer)

The updatePanel method is triggered either from a layer.showCallbacks[] method or from the mapview.Map changeend event listener. The execution of the queries is therefore debounced to 1 second to prevent multiple expensive queries running at the same time. The method will shortcircuit if the layer is not displayed nor has current filter.

The method will hide the location count prior to the debounce.

Within the debounce the location count will be executed. The min max will be generated for current integer or numeric filter.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.filterObject

The layer filter configuration.

filter.currentObject

The filter currently applied to the layer.

filter.viewportBoolean

The filter are restricted to the mapview viewport.

filter.countHTMLElement

The location count element in the filter panel.

/ui/layers/panels/reports

Exports a function for creating a drawer or just a panel which contains links to custom views.

    {
      "report_1":{
        "template": "report_template"
      }
    }

Supplying layer.reports.drawer: false will return the links a plain dev instead of a drawer

Methods

(inner) filterDialog(layer)

The filterDialog method creates a button to toggle the filter dialog if configured.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.filterObject

The layer filter configuration.

filter.dialogObject<optional>

The configuration for the filter dialog.

dialog.btn_titleString<optional>

The title string for the filter dialog toggle button.

dialog.btn_labelString<optional>

The label string for the filter dialog toggle button.

dialog.showOnLayerDisplayObject<optional>

Show dialog in layer showCallback.

(inner) filterPanel(layer) → {HTMLElement}

The filterPanel method will call the multi_filter method to update the filter configuration in regards to the legacy multi_filter plugin.

The method will shortcircuit if the filter panel is set to be hidden or if the layer has no infoj entries to create a list of filter.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.infojArray

Array of infoj entries.

layer.filterObject

Configuration object for layer filter.

filter.hiddenBoolean<optional>

The filter panel should not be displayed.

Returns:

The filter panel drawer element or filter dialog button.

Type: 
HTMLElement

(inner) listFilter(layer) → {Array}

Parse layer.infoj entries to create a list of layer filter objects.

Any entry with a filter defintion will be included in the list unless specifically excluded in the layer.filter configuration.

A filter definition will be created for all entries if possible with the includeAll layer.filter flag or if the entry.field is in the layer.filter.include[] array.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeAttributesDescription
layer.filterObject

Configuration object for layer filter.

filter.excludeArray<optional>

Array of filter [fields] which are excluded in the filter list.

filter.includeArray<optional>

Array of filter [fields] which should be included in the filter list.

filter.includeAllBoolean<optional>

Include all possible infoj entry in filter list.

Returns:

Array of cloned entry.filter

Type: 
Array

(inner) multi_filter()

Support for multi_filter legacy plugin and configuration. Warning will be issued if the multi_filter plugin is configured. The filter panel method will shortcircuit with the hidden flag set by the multi_filter plugin. The hidden flag property will be deleted with the multi_filter layer configuration but the plugin not loaded.

(inner) openDialog(layer)

Opens the filter panel in a dialog.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.filterObject

The configuration parameters of the filter on the layer.

(inner) reports(layer) → {HTMLElement}

Creates a list of a elements containing links to custom views.

Specifying layer.reports.drawer: false will prevent a drawer from being made for the reports panel.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.reportsArray

The configuration of the reports

Returns:

The report element for the panel.

Type: 
HTMLElement

(inner) updatePanel(layer)

The updatePanel method is triggered either from a layer.showCallbacks[] method or from the mapview.Map changeend event listener. The execution of the queries is therefore debounced to 1 second to prevent multiple expensive queries running at the same time. The method will shortcircuit if the layer is not displayed nor has current filter.

The method will hide the location count prior to the debounce.

Within the debounce the location count will be executed. The min max will be generated for current integer or numeric filter.

Parameters:
NameTypeDescription
layerObject
Properties
NameTypeDescription
layer.filterObject

The layer filter configuration.

filter.currentObject

The filter currently applied to the layer.

filter.viewportBoolean

The filter are restricted to the mapview viewport.

filter.countHTMLElement

The location count element in the filter panel.