Feature Queries
LocalMaps Feature Queries allow you to view additional information about a feature that doesn’t exist on the layer itself. Data in a feature query could be spatial (i.e., coming from an ArcGIS Server Service).
For example, the map below shows a property layer that has feature queries associated with it. The first layer displayed in the popup panel is the core layer itself, i.e., Property. Listed beneath this are two feature queries (Regional Council and TLA Boundaries).
If a Feature Query pulls back records associated with that feature (in this case the property), the user can then view the feature queries by clicking on the dropdown arrow. In the case of Spatial queries, the geometry will also be drawn on the map. As the user scrolls through the spatial feature query records, the point location will update to the resource consent being viewed.
Create a Feature Query
-
In the admin panel navigate to the Feature Query tab.
-
Click the “Add Feature Query” button.
-
The first step is to select the query layer. You can choose to search query layers from your content, i.e. from Portal or ArcGIS online, or from a data source that’s been set up. Either paste in the URL of the service you want to query against or search for the query layer you want to use. When you select the query layer, it will auto-populate the Currently Selected Query Layer field. Click next.
-
Configure the name of the query and the title of result. This will be displayed in the feature pop-up. Click next.
-
Selecting the data to be displayed.
- Select the fields you wish to include in the Feature Query.
- Reorder how the fields are presented in the popup by clicking the dotted icon and dragging the field to a new position.
- The Query name is the title that will appear in the popup.
- To display the result along with dynamic hyperlinks, click the icon to the right of the text input. This gives a toggle to display as a hyperlink.
- Toggle the hyperlink on and click on the icon next to the field to configure the hyperlink behavior.
- You can configure any static url (e.g.
https://www.google.com/search?q=
) or dynamic url with the query result (e.g.[${$feature.TA_NAME}](https://www.google.com/search?q=${$feature.TA_NAME})
) Click save when you are done
-
Now the Feature Query is saved and configured, the next step is to assign it to a map. Do this by navigating to the Maps & Apps tab. Click on the map you want to assign the Feature Query to. Click the Feature Queries tab and then “Add Feature Query” button.
-
Select the query and query layer.
- Layer queries allow you to query a hosted feature service with a table join
- Spatial queries allow you to create a feature query against a feature service
-
Click save and the feature query will be assigned to the map.