As of Weave 2.6.6, it’s possible to define filters that can be associated with a map layer. The filters are used when the layer is drawn to refine the set of features that will be rendered for the layer. Additionally, a new client panel allows the user to dynamically alter the filter, giving them the ability to dynamically refine the features displayed on the map.
...
The client UI for the filtering contains a couple of new controls that were not previously available with other input forms, the slider and multi-slider. These controls are useful for layer filtering because they provide an easier way to constrain a numeric value to a certain range but they’re also different in that they force a value to have to be chosen, that is a filter the uses a slider for a value will always have that value applied when displaying the layer, which can be important when the table behind the layer contains a number of “sets” of data but only one should be displayed at a time, and the column behind the parameter is used to separate out the data into the various sets, for example, this could be the year when the data in the table was generated and the user would only want to see a single year at a time, or for a layer with flood levels and you only want to show a single depth.
In addition to the filter panel, there is also a ToC panel right-click context menu item, weave.toc.filterLayer
, that can be added to the ToC panel context menu to allow the user to filter a layer directly. It’s recommended that either the filter panel or context menu item be used at one time.
Finally, there is a new flag available for the ToC panel, showFilterIcon
, which when set to true will place an indicator icon next to a layer in the ToC that currently has a filter applied.
Current limitations
There can be only one filter associated with a particular map layer, this is unlikely to change.
...
Name | Type | Cardinality |
parameter | urn:com.cohga.weave.map.filter#1.0:parameter | 01..n |
parameter
...
Properties
Name | Type | Required | Default | Description |
id | string | yes | A unique identifier for the parameter | |
label | string | yes | The prompt text displayed when user input the parameter value | |
column | string | yes | The name of the column within the layer that this parameter references. | |
controlType | 'text', '‘list', 'radio', ‘check', ‘multicheck’, 'silder’, 'multislider’ | no | 'text' | The UI control to use when displaying the parameter |
dataType | 'boolean', 'float', 'integer', 'string' | no | 'string' | The data type for the parameter |
allowBlank | boolean | no | true | Give the user the choice of an empty value in the listbox (as opposed to a null value) |
value | any | no | The default value of the parameter (except multislider fields) | |
dataSet | no | Where to get the values for a listbox | ||
labelColumn | string | no | Column in the datadefinition that supplies the label of the value to show the user | |
valueColumn | string | no | Column in the datadefinition that supplies the value of the value to use in the SQL | |
scalarparametertype | string | no | 'simple' | 'simple' or 'multi-value' to determine of more than one value can be selected from a list. |
width | integer | no | Set the width of the field | |
minValue | number | yes - for slider and multislider | The minimum value allowed for a numeric field. | |
maxValue | number | yes - for slider and multislider | The maximum value allowed for a numeric field. | |
leftValue | number | no | The initial minimum value for a multislider | |
rightValue | number | no | The initial maximum value for a multislider | |
increment | number | no | The increment to use for fields that support it, the units are dependant upon the field type. | |
trueValue | any | no | The value that equates to "true" in the underlying table, only suitable for checkboxes | |
falseValue | any | no | The value that equates to "false" in the underlying table, only suitable for checkboxes | |
decimalPrecision | number | no | The precision of any numeric fields |
...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:filter="urn:com.cohga.weave.map.filter#1.0" xmlns:data="urn:com.cohga.server.data.database#1.0"> <!-- provide the values for the title names list --> <data:datadefinition id="titles.names"> <datasourcedataconnection datasource="main" table="TITLES" prefix="DISTINCT"> <parameter name="title_name" label="Title Name" column="TITLENAME"/> </datasourcedataconnection> </data:datadefinition> <!-- create a simple list parameter to filter on title name --> <filter:layer id="titles"> <label>Titles</label> <mapengine>main</mapengine> <layer>titles</layer> <parameter id="name"> label="Name" <label>Name</label> <controlType>list</controlType> <scalarParameterType>multi-value</scalarParameterType>controlType="list" scalarParameterType="multi-value" <dataSet>titles.names</dataSet> <column>TITLENAME</column> </parameter>dataSet="titles.names" column="TITLENAME"/> </filter:layer> </config> |
...