ShapeTool

Allows you to create polygon or polyline geometries with a geometric shape by using a single drag interaction. Create a new shape tool using ShapeTool.create(ShapeToolType) and specify the type of shape to be created

You can select different GeometryEditorElement objects by tapping, move selected elements, and use transformation control handles to rotate and scale the selected elements, subject to the current ShapeTool.configuration.

You can also use this tool to add new geometric shaped parts to existing polygon or polyline geometries by setting InteractionConfiguration.allowPartCreation to true in the ShapeTool.configuration and calling GeometryEditor.start(Geometry). You cannot use ShapeTool to create geometry types other than GeometryType.Polygon or GeometryType.Polyline.

By default, this tool does not display vertices or mid-vertices because you do not interact with individual vertices using this tool. The appearance can be customized by changing ShapeTool.style. By default, this tool enables creation, selection, transformation, and deletion. This behavior can be customized with ShapeTool.configuration.

Since

200.2.0

See also

Constructors

Link copied to clipboard
constructor(shapeType: ShapeToolType)

Create a ShapeTool to draw the specified ShapeToolType.

Properties

Link copied to clipboard

Defines the set of interactive operations enabled when using this tool. By default, this tool has an InteractionConfiguration.allowPartCreation value of false in the ShapeTool.configuration, which allows only the initial part of the specified shape to be added interactively - subsequent interactions may navigate the map view instead of changing the geometry. To add additional parts to the geometry with each new drag interaction, each with the specified ShapeToolType, set InteractionConfiguration.allowPartCreation to true.

Link copied to clipboard

The type of geometric shape drawn by this tool, set at instantiation using ShapeTool.create(ShapeToolType).

Inherited properties

Link copied to clipboard

Defines the visual appearance of GeometryEditor geometries when this tool is in use. When a GeometryEditorTool is created, a consistent set of default symbology appropriate for that tool type is applied to its GeometryEditorTool.style property. For example, FreehandTool and ShapeTool define all vertex symbols as null by default because they use drag gestures to define entire parts of polyline and polygon geometries, whereas the VertexTool defines non-null vertex symbols because it is important to be able to see and interact with individual vertices when editing geometries with this tool.