/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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Attributes | Description |
---|---|---|---|
layer.filter | Object | The layer filter configuration. | |
filter.dialog | Object | <optional> | The configuration for the filter dialog. |
dialog.btn_title | String | <optional> | The title string for the filter dialog toggle button. |
dialog.btn_label | String | <optional> | The label string for the filter dialog toggle button. |
dialog.showOnLayerDisplay | Object | <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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Attributes | Description |
---|---|---|---|
layer.infoj | Array | Array of infoj entries. | |
layer.filter | Object | Configuration object for layer filter. | |
filter.hidden | Boolean | <optional> | The filter panel should not be displayed. |
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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Attributes | Description |
---|---|---|---|
layer.filter | Object | Configuration object for layer filter. | |
filter.exclude | Array | <optional> | Array of filter [fields] which are excluded in the filter list. |
filter.include | Array | <optional> | Array of filter [fields] which should be included in the filter list. |
filter.includeAll | Boolean | <optional> | Include all possible infoj entry in filter list. |
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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Description |
---|---|---|
layer.filter | Object | 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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Description |
---|---|---|
layer.reports | Array | The configuration of the reports |
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.
Name | Type | Description |
---|---|---|
layer | Object |
Name | Type | Description |
---|---|---|
layer.filter | Object | The layer filter configuration. |
filter.current | Object | The filter currently applied to the layer. |
filter.viewport | Boolean | The filter are restricted to the mapview viewport. |
filter.count | HTMLElement | The location count element in the filter panel. |