Tools
List of tools
Use the ID from the following table to make the respective function available in an app:
Bundle | Tool ID | Function |
---|---|---|
|
|
Display, Transform, Copy and Search Coordinates |
|
|
Create or edit map objects |
|
|
Show legend |
|
|
Show the current location on the map |
|
|
Align map to north |
|
|
Return to initial view |
|
|
Zoom in map |
|
|
Zoom out map |
|
|
Moves the view to the previous recorded position (scale and center) |
|
|
Moves the view to the next recorded position (scale and center) |
|
|
Measure the distance between two points |
|
|
Measure an area and its perimeter |
|
|
Measure the distance between two points |
|
|
Measure an area and its perimeter |
|
|
Open Web Scenes slides |
|
|
Create a printout of the map |
|
|
Open result center |
|
|
Select objects on the map |
|
|
Share app with parameterized link |
|
|
Draw objects on the map |
|
|
Draw a point on the map |
|
|
Draw a line on the map |
|
|
Draw a rectangle on the map |
|
|
Draw a polygon on the map |
|
|
Draw a circle on the map |
|
|
Delete all drawings |
|
|
Delete selected drawings |
|
|
Map content control |
|
|
Switch between 2D and 3D view |
Configuration of toolsets
Tools are integrated into an app with the help of toolsets. The following code sample 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"]
}
}
}
}
}
Provide user specific tools
The following configuration can be used in combination with map.apps User Management , security.manager or ArcGIS Online/ArcGIS Enterprise portal.
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"]
}
}
}
}
}
Note, that this requires the authentication
bundle to be configured as well.
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 |
---|---|---|
|
Tool visible, but disabled (grayed out) |
Tool visible and enabled (not activated!) |
|
Tool not visible |
Tool visible and enabled (not activated!) |
|
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, see the bundle documentation . |