Editing

Required bundle: editing

Add editing functionality to an app

To enable the editing of features in an app one or more ArcGIS Feature Layers that allow the editing of features have to be added to the app.

In the next step the tool for editing must be added to a toolset, see configuration of tools. Afterwards a dialog is available to the user that allows to edit existing geoobjects and add new ones. Existing features can be deleted in the step Edit feature - if the service allows it.

editing

Configuration

The following parameters are available for configuration:

allowedWorkflows

Specifies which workflows can be started by the user.

Default: ["create", "update"]

allowFeatureTemplateFiltering

Determines whether the user is shown a text field for filtering the templates.

Default: true

groupFeatureTemplatesBy

Specifies how the templates are grouped.

Allowed values:

layer

templates are grouped according to the layer they belong to.

geometry

templates are grouped according to the type of their geometry (points, lines, polygons)

none

all templates are listed without grouping.

initialGeometryEditMode

Defines which editing mode is activated when editing geometries.

Allowed values:

transform

allows to move, resize and rotate a geometry.

reshape

allows to move a geometry as well as moving or adding vertices of a geometry.

move

allows to move a geometry without changing its vertices, size or rotation.

toggleGeometryEditModeOnClick

Determines whether the user can switch between the editing modes by clicking on the geometry.

snappingEnabled

Determines whether snapping is enabled while editing.

{
    "editing": {
        "Config": {
            "allowedWorkflows": [
                "create",
                "update"
            ],
            "allowFeatureTemplateFiltering": true,
            "groupFeatureTemplatesBy": "layer",
            "initialGeometryEditMode": "reshape",
            "toggleGeometryEditModeOnClick": true,
            "snappingEnabled": true
        }
    }
}

Customize attribute editing dialog

To customize the input masks for attribute editing, so-called FormTemplates can be used, which must be defined at the respective Feature Layer. This allows to define a selection of the displayed attributes, their order and grouping.

The following code sample shows the definition of a FormTemplate:

{
    "map-init": {
        "Config": {
            "basemaps": [],
            "map": {
                "layers": [
                    {
                        "id": "status",
                        "url": "https://services.conterra.de/arcgis/rest/services/mapapps/stoerung/FeatureServer/1",
                        "type": "AGS_FEATURE",
                        "title": "Layer with custom formTemplate",
                        "formTemplate": {
                            "title": "Bürger melden Störungen",
                            "description": "Helfen Sie dabei, unsere Stadt schön zu halten!",
                            "elements": [
                                {
                                    "type": "group",
                                    "label": "Art der Störung",
                                    "description": "Im ersten Schritt, geben Sie bitte die Art der Störung ein.",
                                    "elements": [
                                        {
                                            "type": "field",
                                            "fieldName": "art",
                                            "label": "Was möchten Sie melden?",
                                            "domain": {
                                                "type": "coded-value",
                                                "codedValues": [
                                                    {
                                                        "name": "Laterne/Beleuchtung",
                                                        "code": 1
                                                    },
                                                    {
                                                        "name": "Ampel",
                                                        "code": 2
                                                    }
                                                ]
                                            },
                                            "input": {
                                                "type": "radio-buttons",
                                                "showNoValueOption": false
                                            }
                                        }
                                    ]
                                },
                                {
                                    "type": "group",
                                    "label": "Details zur Erfassung",
                                    "description": "Geben Sie in diesem Schritt optional weitere Informationen ein.",
                                    "elements": [
                                        {
                                            "type": "field",
                                            "fieldName": "details",
                                            "label": "Details zur Meldung"
                                        },
                                        {
                                            "type": "field",
                                            "fieldName": "zeitpunkt",
                                            "label": "Zeitpunkt der Meldung"
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ]
            }
        }
    }
}
For more information about configuration, see the bundle documentation .