Tools

List of tools

Use the ID from the following table to make the respective function available in an app:

Bundle Tool ID Function

coordinateconversion

coordinateconversionToggleTool

Display, Transform, Copy and Search Coordinates

editing

editingToggleTool

Create or edit map objects

legend

legendToggleTool

Show legend

locateme

locateMeTool

Show the current location on the map

mapnavigation

compassTool

Align map to north

mapnavigation

restoreInitialViewTool

Return to initial view

mapnavigation

zoomInTool

Zoom in map

mapnavigation

zoomOutTool

Zoom out map

mapnavigation

moveToPreviousViewTool

Moves the view to the previous recorded position (scale and center)

mapnavigation

moveToNextViewTool

Moves the view to the next recorded position (scale and center)

measurement-2d

distanceMeasurement2DToggleTool

Measure the distance between two points

measurement-2d

areaMeasurement2DToggleTool

Measure an area and its perimeter

measurement-3d

lineMeasurement3DToggleTool

Measure the distance between two points

measurement-3d

areaMeasurement3DToggleTool

Measure an area and its perimeter

portal-webscene-slides

slideSelectorToggleTool

Open Web Scenes slides

printing

printingToggleTool

Create a printout of the map

resultcenter

resultcenterToggleTool

Open result center

selection-ui

selection-ui-tool

Select objects on the map

share-link

sharelinkTool

Share app with parameterized link

sketching

sketchToggleTool

Draw objects on the map

sketching

pointSketchTool

Draw a point on the map

sketching

lineSketchTool

Draw a line on the map

sketching

rectangleSketchTool

Draw a rectangle on the map

sketching

polygonSketchTool

Draw a polygon on the map

sketching

circleSketchTool

Draw a circle on the map

sketching

deleteAllSketchTool

Delete all drawings

sketching

deleteSelectedSketchTool

Delete selected drawings

toc

tocToggleTool

Map content control

viewmodeswitcher

viewmodeSwitcherTool

Switch between 2D and 3D view

Configuration of toolsets

Tools are integrated into an app with the help of toolsets. The following example shows the configuration of the two toolsets that are preconfigured in the default app:

{
    "toolset": {
        "ToolsetManager": {
            "toolsets": [
                {
                    "id": "mapview_tools",
                    "tools": [
                        "locateMeTool",
                        "zoomInTool",
                        "zoomOutTool",
                        "compassTool",
                        "restoreInitialViewTool",
                        "viewmodeSwitcherTool"
                    ],
                    "tooltipPositions": [
                       "before",
                       "above",
                       "below",
                       "after"
                    ],
                    "registerWidget": {
                        "widgetRole": "mapview_tools"
                    },
                    "container": "ignore",
                    "windowType": "container",
                    "cssClass": "muted"
                },
                {
                    "id": "drawer_left",
                    "title": "Werkzeuge",
                    "cssClass": "ct-main-app-menu",
                    "tools": [
                        "selection-ui-tool",
                        "printingToggleTool",
                        "sharelinkTool",
                        "coordinateconversionToggleTool",
                        "distanceMeasurement2DToggleTool",
                        "areaMeasurement2DToggleTool",
                        "lineMeasurement3DToggleTool",
                        "areaMeasurement3DToggleTool"
                    ],
                    "tooltipPositions": [
                       "after",
                       "above",
                       "below",
                       "before"
                    ],
                    "registerWidget": {
                        "widgetRole": "drawer_button"
                    },
                    "container": "ignore",
                    "windowType": "drawer_left"
                }
            ]
        }
    }
}

The toolset with the ID mapview_tools is displayed in the bottom right corner of the default app and contains tools such as zooming. The toolset with the ID drawer_left is opened in the default app to the left of the search and expanded from the left side. The section "tools": […​] indicates which tools are displayed in the respective toolset. To customize the app to your needs, remove entries or add new ones (see list of tools).

You can add more toolsets to an app.

An overview of the different types of toolsets and their configuration can be found in the bundle documentation .

Automatically control tools with tool rules

Activate tool at start of an app

To activate a tool automatically when an app starts, use the following configuration:

{
    "toolrules": {
        "ToolActiveStateManager": {
            "activateOnStartToolIds": [
                "tocToggleTool"
            ]
        }
    }
}

With this example configuration, the map content control is displayed directly when the app is started.

Control tools depending on the map state

To enable a tool depending on the current map scale, use the following configuration:

{
    "toolrules": {
        "ToolRuleManager": {
            "_rules": {
                "editingToggleTool": {
                    "maxScale": 10000,
                    "minScale": 200000
                }
            }
        }
    }
}

To enable a tool depending on the state of certain layers (enabled/disabled), use the following configuration:

{
    "toolrules": {
        "ToolRuleManager": {
            "_rules": {
                "editingToggleTool": {
                    "layerVisible": ["mylayer"]
                }
            }
        }
    }
}

Providing User Specific Tools

The following configuration can be used in combination with map.apps User Management , security.manager or ArcGIS Online/Portal for ArcGIS.

To provide user specific tools, you can configure the toolrules bundle. Assign the role to the tool to make it accessible by users with this role.

{
    "toolrules": {
        "ToolRuleManager": {
            "_rules": {
                "editingToggleTool": {
                    "roles": ["maAdmin"]
                }
            }
        }
    }
}

Show or activate tools based on rules

By default, the rules described previously set a tool to disabled mode (grayed out) and can only be switched on (no longer grayed out) if the respective rule is fulfilled successfully. Alternatively, the ruleSuccessProperty parameter can be used to specify that a tool is automatically displayed or activated:

Value Behavior if the rule is not fulfilled Behavior if the rule is fulfilled

enabled (default )

Tool visible, but disabled (grayed out)

Tool visible and enabled (not activated!)

visibility

Tool not visible

Tool visible and enabled (not activated!)

active

Tool visible and enabled (not activated!)

Tool visible and activated

The active option only has an effect with tools that are toggable. These are, for example, tools that open a window and not those that perform a one-time action (such as zooming into the map).

The following configuration opens an edit window as soon as a certain map layer is activated:

{
    "toolrules": {
        "ToolRuleManager": {
            "_rules": {
                "editingToggleTool": {
                    "layerVisible": ["mylayer"],
                    "ruleSuccessProperty": "active"
                }
            }
        }
    }
}
For more information about tool rules, refer to the bundle documentation .