Spatial Selection

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.

result ui

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, result-ui

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

To customize the behavior of the tool presented above, use the following configuration:

preselectSources

Determines whether the available data sources are to be selected when the window is opened.

Allowed values:

all

selects all data sources

none

does not select a data source

disabled

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

Default: all

activateSelectionMethod

Determines whether the first selection method is to be activated when the window is opened.

Default: true

closeOnSelection

Determines whether the window is to be closed after a selection.

Default: true

selectionMethods

Determines which selection methods are offered to the user.

Allowed values: rectangle, point, polygon
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, result-ui

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 .