Spatial Selection
Overview
Information about map objects can be queried and displayed using the spatial selection and the result center. In contrast to Popups, the information can be queried not only at a specific location, but also in a larger area, which can be defined by the user, for example by drawing a rectangle.
Data sources
Required Bundle: agssearch
ArcGIS Map or Feature layers supporting the query
operation can be used as data sources.
Automatic registration
If the automatic registration is active and the parameter useIn
contains the value selection
, all ArcGIS map and feature layers visible in the map are used for the spatial selection.
The title of the layer and the names of attributes are requested from the service and used for display in the user interface.
{
"agssearch": {
"AutoStoreRegistration": {
"componentEnabled": true,
"useIn": [
"search",
"selection"
]
}
}
}
Manual registration
With the following configuration, layers used in the map can be registered for spatial selection:
{
"agssearch": {
"AGSStore": [
{
"id": "store01",
"title": "Gemeinden in Deutschland (MapServer Layer)",
"layerId": "grenzen/0",
"useIn": [
"selection"
]
},
{
"id": "store02",
"title": "Gemeinden in Deutschland (Feature Layer)",
"layerId": "gemeindelayer",
"useIn": [
"selection"
]
}
]
},
"map-init": {
"Config": {
"map": {
"layers": [
{
"id": "grenzen",
"type": "AGS_DYNAMIC",
"url": "https://services.conterra.de/arcgis/rest/services/common/grenzen/MapServer",
"sublayers": [
{
"id": 0,
"title": "Gemeinden"
}
]
},
{
"id": "gemeindelayer",
"url": "https://services.conterra.de/arcgis/rest/services/common/grenzen/FeatureServer/0",
"type": "AGS_FEATURE"
}
]
}
}
}
}
Alternatively, the URL of a layer can be defined independently of the reference to a map configuration:
{
"agssearch": {
"AGSStore": [
{
"id": "store01",
"title": "Gemeinden in Deutschland",
"url": "https://services.conterra.de/arcgis/rest/services/common/grenzen/MapServer/0",
"useIn": [
"selection"
]
}
]
}
}
Tools for spatial selection
Default Tool
Required Bundles: selection-ui, selection-resultcenter
Add the tool with the ID selection-ui-tool
to a toolset to add the default tool for selecting objects from one or more layers to an app.
Data sources defined using automatic registration or link to a map layer are hidden when the corresponding map layer is disabled. Data sources defined with their URL are always usable.
The user can draw a point, a rectangle or a polygon as selection geometry in the map. This starts a spatial selection on the objects of all selected data sources. All selected objects are displayed in the result center and highlighted in the map.
In the live configuration, the section "Search & Spatial Selection" → "Spatial Selection" provides an area for configuring the behavior of the tool presented preceding. Alternatively, the values can be set in the App Editor.
The following options are available:
Name | Description |
---|---|
|
Determines whether the available data sources are to be selected when the window is opened. The following values are available:
|
|
Determines whether the first selection method is to be activated when the window is opened.
Default value: |
|
Determines whether the window is to be closed after a selection.
Default value: |
|
Determines which selection methods are offered to the user.
The following values are available as part of the default: |
{
"selection-ui": {
"Config": {
"preselectSources": "all",
"activateSelectionMethod": true,
"closeOnSelection": true,
"selectionMethods": [
"*"
]
}
}
}
For more information about configuration, see the bundle documentation . |
Tools for individual layers
Required Bundles: selection-tools, resultcenter
The bundle selection-tools
lets you configure dedicated selection tools, in which a data source is directly connected to a geometry tool.
{
"selection-tools": {
"Config": {
"tools": [
{
"id": "selectCountries",
"selectionMethod": "point",
"selectionOptions": {
"clickTolerance": 10
},
"sourceId": "countries",
"iconClass": "icon-map-selection"
}
]
}
}
}
For more information about configuration, see the bundle documentation . |
Tools for direct display of data in the Result Center
Required Bundle: resultcenter
With this configuration, a tool is created whose activation causes all objects of a data source to be displayed directly in the results center.
{
"resultcenter": {
"SearchStoreTool": [
{
"tools": [
{
"id": "selectAllCountries",
"storeId": "countries",
"iconClass": "icon-map-selection"
}
]
}
]
}
}