InteractionConfiguration

Defines the set of interactive operations you can enable or disable for a VertexTool, FreehandTool, or ShapeTool. An InteractionConfiguration allows you to customize the interactive geometry editing experience to suit your specific users. For example:

You can tap multiple times on any GeometryEditorElement to select the different types of GeometryEditorElement representing vertices, parts, and the entire geometry. For example if all elements are allowed to be selected:

  • tap twice on a vertex of a Multipoint to select first the vertex and then the entire multipoint geometry

  • tap three times on a vertex of a Polyline or Polygon to select first the vertex, then the part, and then the entire geometry

  • tap twice on an edge of a Polyline or Polygon to select first the part and then the entire geometry

  • tap twice on a fill of a Polygon to select first the part and then the entire geometry

Depending on the values of InteractionConfiguration.allowMovingSelectedElement, InteractionConfiguration.allowRotatingSelectedElement, and InteractionConfiguration.allowScalingSelectedElement, visual handles are displayed to help the user move, rotate, or scale the selected element.

You can change the interaction properties of a tool at any point, including when a geometry editor is started (GeometryEditor.isStarted = true) and the tool is in use by the editor. If you change a property that disallows an in-progress interaction, then the interaction is cancelled and does not affect the state of the GeometryEditor.

Changing InteractionConfiguration properties affects whether types of interaction (such as tapping or dragging) to add new vertices or parts are enabled or not, but never affects the type of interaction used by each different GeometryEditorTool to create new vertices and parts. For example, a VertexTool adds vertices in response to a tap, whereas both FreehandTool and ShapeTool add parts in response to a drag operation but never in response to a tap.

Convenience methods are available to quickly set all properties relative to a category of interaction - for example use InteractionConfiguration.setAllowSelection(Boolean) to change all selection interactions, and InteractionConfiguration.setAllowTransformation(Boolean) to change all properties that control geometry transformation.

Since

200.1.0

See also

Constructors

Link copied to clipboard
constructor()

Creates an InteractionConfiguration that enables selection, transformation and deletion. Defines the most powerful and least restrictive interactive experience. When you create a new GeometryEditorTool, its InteractionConfiguration property defines the values appropriate for that type of tool, which may differ from the default values set by this constructor. For more information on the different default values for these tools, see VertexTool, FreehandTool, and ShapeTool.

Properties

Link copied to clipboard

True if the selected GeometryEditorElement can be interactively deleted, false otherwise. Default is true. Whether true or false, an element can be deleted by GeometryEditor.deleteSelectedElement().

Link copied to clipboard

True if the entire geometry can be interactively selected, false otherwise. Default is true. If true, you can tap multiple times on elements of the geometry to make the entire geometry selected.

Link copied to clipboard

True if a mid-vertex of a polygon or polyline can be interactively selected, false otherwise. Default is true. By default, mid-vertices (GeometryEditorMidVertex) are displayed and can be helpful in interactive workflows to provide a visual cue that new vertices can be inserted between the existing vertices of polygons and polylines. They may be most helpful for users with less editing experience.

Link copied to clipboard

True if the selected GeometryEditorElement can be interactively moved, false otherwise. Default is true. If true, you can use a drag gesture to move the selected GeometryEditorElement to the required location. Create a tool to allow moving only specific types of GeometryEditorElement by also allowing or disallowing the selection of different types of element (InteractionConfiguration.allowVertexSelection for example).

Link copied to clipboard

True if you can interactively create a new part in a polyline or polygon, false otherwise. Default is true. If true and the GeometryType of the GeometryEditor.geometry is a polygon or polyline, you can you can add new parts to the Multipart geometry - the GeometryEditor.tool determines the interaction required to add the new part. If the GeometryType of the GeometryEditor.geometry is a point or multipoint, this property is ignored. For new geometry creation (using GeometryEditor.start(GeometryType), or calling GeometryEditor.start(Geometry) with an empty geometry), this property is always ignored when adding the first part, and respected thereafter.

Link copied to clipboard

True to allow a part of a Multipart geometry (Polyline or Polygon) to be selected interactively, false otherwise. Default is true. If true, you can tap on the edge of a polygon or polyline GeometryEditorGeometry in order to the select the part.

Link copied to clipboard

True to allow you to interactively rotate the selected GeometryEditorElement, false otherwise. Default is true. This property applies when the GeometryEditor.selectedElement is:

Link copied to clipboard

True to allow you to interactively scale the selected GeometryEditorElement, false otherwise. Default is true. This property applies when the GeometryEditor.selectedElement is:

Link copied to clipboard

True to allow a vertex to be created interactively, false otherwise. Default is true. If true, you can tap on the map to add a new vertex. The vertex is inserted after the previously selected vertex, or as the first vertex if the previous selection was the first vertex in a Polyline. If you tap on an existing GeometryEditorElement then selection occurs instead.

Link copied to clipboard

True to allow vertices to be selected interactively, false otherwise. Default is true. If true, you can tap on a vertex to select it.

Link copied to clipboard

True to require a GeometryEditorElement to first be selected before it can be moved by interactively dragging, false otherwise. Default is false. By default, you can select and immediately move an element in one gesture. Some users may find this can lead to an increase in accidental element moves when editing. By setting this to true, this can reduce the possibility of accidental moves. Alternatively, you may wish to provide access to GeometryEditor.undo() and GeometryEditor.redo() to provide easy correction of accidental edits.

Link copied to clipboard

Determines how a geometry can be interactively scaled (resized) to fill its allocated space while using the GeometryEditor. This property is ignored during geometry editing if InteractionConfiguration.allowScalingSelectedElement is false. It will be used to define how geometries are initially created by a drag interaction when the active tools is a ShapeTool regardless of the value of InteractionConfiguration.allowScalingSelectedElement.

Functions

Link copied to clipboard
fun setAllowCreation(allowCreation: Boolean)

Enable or disable creation. Sets the following properties:

Link copied to clipboard
fun setAllowDeletion(allowDeletion: Boolean)

Enable or disable deletion. Sets the following properties:

Link copied to clipboard
fun setAllowSelection(allowSelection: Boolean)

Enable or disable selection. Sets the following properties:

Link copied to clipboard
fun setAllowTransformation(allowTransformation: Boolean)

Enable or disable interactions that transform the GeometryEditor.geometry, for example InteractionConfiguration.allowMovingSelectedElement. Sets the following properties: