Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is similar to the search panel where the user can enter certain criteria to select a set of entities, but in this case, the input the user enters is used to refine the set of features displayed on the map. For example, if the map contains a layer representing the public reserves, a filter could be created for the reserves layer that allows the user to display only those reserves containing a specific facility or facilities, i.e. only those reserves with barbeques and/or public toilets.

The panel to include in the client to allow the user to alter the filters has the id weave.layerFilter.

Current limitations

There can be only one filter associated with a particular map layer, this is unlikely to change.

...

Name

Type

Required

Description

value

string

yes

Value to be used in the filter

label

string

yes

Text to be displayed to the user to represent this filter

checked

string

no

Should this check box be initially checked. Only for list within multicheck field

Examples

Code Block
languagexml
<?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>
      <controlType>list</controlType>
      <scalarParameterType>multi-value</scalarParameterType>
      <dataSet>titles.names</dataSet>
      <column>TITLENAME</column>
    </parameter>
  </filter:layer>

</config>

Code Block
languagexml
<!-- parameter examples -->

<!-- a parameter representing a floating point value between 2.5 and 26 with an increment of 0.5
and default value of 13 -->
  <parameter id="level">
    <label>Level (m)</label>
    <controlType>slider</controlType>
    <dataType>float</dataType>
    <column>Level_mGH</column>
    <minValue>2.5</minValue>
    <maxValue>26</maxValue>
    <value>13</value>
    <increment>0.5</increment>
    <decimalPrecision>1</decimalPrecision>
  </parameter>

<!-- a parameter representing an integer value between 2011 and 2019 inclusive 
with a default minimum of 2015 and default maximum of 2018 -->
  <parameter id="study_year">
    <label>Study Year</label>
    <controlType>multislider</controlType>
    <dataType>int</dataType>
    <column>Study_year</column>
    <minValue>2011</minValue>
    <maxValue>2019</maxValue>
    <leftValue>2015</leftValue>
    <rightValue>2018</rightValue>
  </parameter>

<!-- multiple grouped check boxes. Note in this case all checked boxes start as checked
but if none of the check boxes are checked all items would be displayed as well -->
  <parameter id="location">
    <label>Location</label>
    <controlType>multicheck</controlType>
    <column>Location</column>
    <dataType>string</dataType>
    <list label="Catchment, Todd" value="Todd Catchment" checked="true"/>
    <list label="River, Adelaide" value="Adelaide River" checked="true"/>
    <list label="River, McArthur" value="McArthur River" checked="true"/>
  </parameter>

<!-- single check box. Note in the case since we've set a different true value
when this check box is checked the filter applied will be "Location='Adelaide River'"
rather than "Location=true" as would be the case if trueValue were no set -->
  <parameter id="location">
    <label>Adelaide River Only</label>
    <controlType>check</controlType>
    <column>Location</column>
    <dataType>string</dataType>
    <trueValue>Adelaide River</trueValue>
  </parameter>

<!-- radio button -->
  <parameter id="location">
    <label>Location</label>
    <controlType>radio</controlType>
    <column>Location</column>
    <dataType>string</dataType>
    <value>Adelaide River</value>
    <list label="Catchment, Todd" value="Todd Catchment"/>
    <list label="River, Adelaide" value="Adelaide River"/>
    <list label="River, McArthur" value="McArthur River"/>
  </parameter>

<!-- list box -->
  <parameter id="location">
    <label>Location</label>
    <controlType>list</controlType>
    <dataSet>locations</dataSet>
    <column>Location</column>
    <dataType>string</dataType>
  </parameter>

<!-- a basic text box. Note this format is discuoraged as the user has no way of knowing 
if the value they're entering is valid and may result in nothing being displayed -->
  <parameter id="location">
      <label>Location</label>
      <controlType>text</controlType>
      <column>Location</column>
    <dataType>string</dataType>
  </parameter>

Client

Code Block
languagexml
	<client:config id="filtering">
		<title>Example Filtering client</title>

		<!-- other config here -->

		<view id="weave.layerFilter">
			<location>east</location>
		</view>

		<!-- other config here -->

	</client:config>