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.

selection resultcenter

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": [
                "omnisearch",
                "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.

selection

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 manual configuration.

The following options are available:

Name Description

preselectSources

Determines whether the available data sources are to be selected when the window is opened. The following values are available:

  • all → selects all data sources (default value)

  • none → does not select a data source

  • disabled → lets you open and close the window without changing the selection made by the user.

activateSelectionMethod

Determines whether the first selection method is to be activated when the window is opened. Default value: true

closeOnSelection

Determines whether the window is to be closed after a selection. Default value: true

selectionMethods

Determines which selection methods are offered to the user. The following values are available as part of the default: extent, point, polygon. Default value: ["*"]

{
    "selection-ui": {
        "Config": {
            "preselectSources": "all",
            "activateSelectionMethod": true,
            "closeOnSelection": true,
            "selectionMethods": [
                "*"
            ]
        }
    }
}
For more information about configuration, refer to 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, refer to 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"
                    }
                ]
            }
        ]
    }
}