mapp.ui.layers.filters[type](layer, filter)
The ui/layers/filters module exports a lookup object for the different layer filter type methods.
- like
- match
- numeric
- integer
- in
- ni
- date
- datetime
- boolean
- null
- Source
Methods
(inner) applyFilter(layer)
The applyFilter method is used to debounce the layer.reload() from filter. This is required in order to not fire layer [data] reload in quick succession by moving a slider element.
The reloadCallback method is provided as callback argument to the layer.reload()
The 'changeEnd' event is dispatched the layer.mapview in order to trigger the update of dataviews with the mapChange flag.
Name | Type | Description |
---|---|---|
layer | Object | The layer to reload. |
- Source
(inner) deleteFilter(layer, filter)
The deleteFilter function deletes the filter in the layer.filter.current object. And applies the changes to the layer.
Name | Type | Description |
---|---|---|
layer | layer | The layer to reload. |
filter | Object | The filter definition. |
Name | Type | Description |
---|---|---|
layer.filter | Object | The filter thats active on the layer. |
filter.field | Object | The field the filter works on. |
filter.type | String | The filters' type e.g like, in, etc. |
- Source
(inner) filter_boolean(layer, filter) → {HTMLElement}
Creates a checkbox element for filtering boolean values.
Name | Type | Description |
---|---|---|
layer | Object | The layer object to apply the filter to. |
filter | Object | The filter configuration object. |
- Source
The checkbox element for boolean filtering.
- Type:
- HTMLElement
(inner) filter_date(layer, filter) → {HTMLElement}
Creates input elements for filtering date values.
Name | Type | Description |
---|---|---|
layer | Object | The layer object to apply the filter to. |
filter | Object | The filter configuration object. |
- Source
The input elements for date filtering.
- Type:
- HTMLElement
(inner) filter_in(layer, filter) → {Promise.<HTMLElement>}
Filter interface elements for in
and ni
type layer filter are returned from the filter_in() method.
The method is async to wait for a distinct values query to populate the filter type [eg. in or ni] values array.
A list of checkbox elements will be returned as default interface without a dropdown
, dropdown_pills
, or searchbox
flag.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
layer | Object | Decorated MAPP Layer Object. | ||||||
filter | Object | The filter object. Properties
|
Name | Type | Attributes | Description |
---|---|---|---|
filter.in | Array | <optional> | Array of values for in type filter. |
filter.ni | Array | <optional> | Array of values for ni type filter. |
filter.dropdown | Boolean | <optional> | Create dropdown [pills] filter interface. |
filter.dropdown_pills | Boolean | <optional> | Create dropdown [pills] filter interface. |
filter.searchbox | Boolean | <optional> | Create searchbox [pills] filter interface. |
- Source
Filter interface elements.
- Type:
- Promise.<HTMLElement>
(inner) filter_null(layer, filter) → {HTMLElement}
Creates a checkbox element for filtering null values.
Name | Type | Description |
---|---|---|
layer | Object | The layer object to apply the filter to. |
filter | Object | The filter configuration object. |
- Source
The checkbox element for null filtering.
- Type:
- HTMLElement
(inner) filter_numeric(layer, filter) → {Promise.<HTMLElement>}
Returns numeric inputs and range slider element as UI for numeric layer filter.
Numeric layer filter are a combination of an LTE (less-than-[or]equal) and GTE (greater-than-[or]equal) filter for a field defined in a matching entry field.
Name | Type | Description |
---|---|---|
layer | layer | MAPP layer typedef object. |
filter | Object | Filter object. |
Name | Type | Attributes | Description |
---|---|---|---|
filter.field | string | Field to filter. | |
filter.min | numeric | <optional> | Min bounds. |
filter.max | numeric | <optional> | Max bounds. |
filter.step | numeric | <optional> | Step for renage slider. |
- Source
The filter UI elements.
- Type:
- Promise.<HTMLElement>
(inner) filter_text(layer, filter) → {HTMLElement}
Creates an input element for filtering text values.
Name | Type | Description |
---|---|---|
layer | Object | The layer object to apply the filter to. |
filter | Object | The filter configuration object. |
- Source
The input element for text filtering.
- Type:
- HTMLElement
(inner) generateMinMax(layer, filter)
Query the min and max values for a numeric filter field.
Name | Type | Description |
---|---|---|
layer | layer | MAPP layer typedef object. |
filter | Object | Filter object. |
Name | Type | Attributes | Description |
---|---|---|---|
filter.field | string | Field to filter. | |
filter.min | numeric | <optional> | Min bounds. |
filter.max | numeric | <optional> | Max bounds. |
filter.minmax_query | string | <optional> | Query template for min max values. |
- Source
(inner) reloadCallback(layer) → {Object}
The reloadCallback renders the layer.style.legend. The legend may reflect changes to the layer.filter.current. The applyFilter method used debounce the layer.reload() provides the reloadCallback as callback argument.
Name | Type | Description |
---|---|---|
layer | Object | The layer to reload. |
- Source
layer - To allow for functional compostion of itself.
- Type:
- Object
(inner) removeFilter(layer, filter)
The removeFilter function removes the selected filter from the panel. Calls module:/ui/layers/filters~applyFilter once the card has been removed to update the layer.
Hides the clearAll and resetAll button if they are no more cards in the panel.
Name | Type | Description |
---|---|---|
layer | layer | The layer to reload. |
filter | Object | The filter definition. |
Name | Type | Attributes | Description |
---|---|---|---|
filter.card | HTMLElement | <optional> | The html element of the filter. |
filter.li | HTMLElement | <optional> | The list element if applicable. |
- Source
(inner) resetFilter(layer, filter)
The resetFilter method deletes the filter and replaces the filter.card with a new card with initial filter config.
Name | Type | Description |
---|---|---|
layer | layer | The layer to reload. |
filter | Object | The filter definition. |
Name | Type | Description |
---|---|---|
filter.card | HTMLElement | The html element of the filter. |
- Source