The Filter widget allows you to limit the visibility of features in a layer. Only the features that meet the expression criteria will be visible in the map. Accordingly, other out-of-the-box widgets, if applicable, will respond to the change it makes in the layer.
Configuring the Filter widget
The Filter widget can be set to open automatically when apps start. To do so, click the dot on the widget to change it to dark green.
- Hover over the widget and click the small edit icon . The configuration window for this widget opens.
- Optionally click change widget icon and replace it with your own image.
A file explorer window opens, allowing you to select a local image file to use as the widget icon.
- Click + New Filter and select a layer from the Layer drop-down list.
- Name the filter in the Title text box.
- Browse to your local images to choose an icon for the filter. The default icon will apply if you don't specify it.
- Optionally click the box left to Remove the preset layer filteres from the map if you don't want to carry over the filters in the map to your app.
- Click Add a filter expression.
- Click the field drop-down arrow and choose the field you want to filter against from the list.
- Click the operators drop-down arrow and choose an operator from the list.
- If you want to filter based on a specific value, choose Value and enter a value in the field. Click the box to the left of Ask for values if you want to set up an interactive expression. Enter information about the value in the Prompt field and a hint in the Hint field.
- If you want to compare the value in one field versus the value in another field, choose Field, click the drop-down arrow, and choose the field for your expression.
- If you want to filter based on a specific value in the field you've selected for your expression, choose Unique and select a unique value from your field. It also allows you to dynamically show the values based on the previous expressions or all other expressions regardless their orders. Enter information about the value in the Prompt field and a hint in the Hint field, and select how the values are listed.
Unique value filters require a 10.1 or later map service layer. The Unique option does not appear if you are creating a filter on a 10.0 or earlier service layer.
To display description for coded values when Values filtered by previous expressions or Values filtered by all other expressions is selected, the service must support the capability of query by statistics.
If you created an expression based on values or a unique value, you can set up an interactive expression by clicking the box to the left of Ask for values. You cannot ask for values on expressions based on a field.
- To create multiple expressions, or one or more sets of expressions, click Add a filter expression or Add an expression set.
A set is a grouping of expressions, for example, Shelter capacity is greater than 200 and Status is open.
- You can decide whether to Turn off query result layers when the widget is closed by using this option.
- To add another filter, repeat steps 1 through 7.
- Hover over the filter you created in the table to delete or order it.
- Click OK to save and close the configuration.
Using the Filter widget
You can apply multiple filters simultaneously or apply an individual filter to the map.
- Click the Filter widget icon to open it.
- Click the filter you specify to limit features on the map. The icon appears after the filter is applied. Click the filter button again to remove the filtering from the map.
- Type a value in the text box and click Apply if Ask for values is checked when the filter is created. Click the filter button to remove the filtering from the map. You may notice the icon. Click it to hide the input box for the query value.