A class that allows the user to sketch geometries on the map. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.12 |
Inherits: |
Properties
- creationMode : Enums.SketchCreationMode
- geometry : Geometry
- opacity : real
- selectedVertex : SketchVertex
- started : bool
- style : SketchStyle
- visible : bool
Signals
- creationModeChanged()
- geometryChanged()
- opacityChanged()
- selectedVertexChanged()
- startedChanged()
- styleChanged()
- visibleChanged()
Methods
- bool insertVertexAfterSelectedVertex(Point point)
- bool isSketchValid()
- bool moveSelectedVertex(Point point)
- void redo()
- bool removeSelectedVertex()
- bool replaceGeometry(Geometry geometry)
- bool startWithCreationMode(Enums.SketchCreationMode creationMode)
- bool startWithCreationModeAndEditConfiguration(Enums.SketchCreationMode creationMode, SketchEditConfiguration editConfiguration)
- bool startWithGeometry(Geometry geometry)
- bool startWithGeometryAndCreationMode(Geometry geometry, Enums.SketchCreationMode creationMode)
- bool startWithGeometryCreationModeAndEditConfiguration(Geometry geometry, Enums.SketchCreationMode creationMode, SketchEditConfiguration editConfiguration)
- void stop()
- void undo()
Detailed Description
Instances of this class represent a sketch editor that allows the user to interactively sketch geometries. You can sketch point, polygon, and polyline geometries from scratch, modify existing geometries, insert and remove vertices, undo and redo changes, and so on.
The sketch editor must be set on the view using the sketchEditor property and then started to perform the sketch based on user interactions.
This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.
Type | Default Property |
---|---|
SketchStyle | style |
Property Documentation
Specifies which type of geometry will be sketched and what type of user interaction is used to create it (read-only).
geometry : Geometry |
The geometry currently being sketched. It is updated as the user interacts with the view (read-only).
The opacity of the SketchEditor. Ranges between 0.0 and 1.0.
selectedVertex : SketchVertex |
The currently selected sketch vertex.
Indicates whether the sketch editor is started and will respond to user interactions with the view (read-only).
[default] style : SketchStyle |
The object describing the styling of the sketch editor.
Whether the SketchEditor is visible
Signal Documentation
Emitted when the creationMode property changes.
Note: The corresponding handler is onCreationModeChanged
.
Emitted when the geometry property changes.
Note: The corresponding handler is onGeometryChanged
.
Emitted when the opacity property changes.
Note: The corresponding handler is onOpacityChanged
.
Emitted when the selectedVertex property changes.
Note: The corresponding handler is onSelectedVertexChanged
.
Emitted when the started property changes.
Note: The corresponding handler is onStartedChanged
.
Emitted when the style property changes.
Note: The corresponding handler is onStyleChanged
.
Emitted when the visible property changes.
Note: The corresponding handler is onVisibleChanged
.
Method Documentation
bool insertVertexAfterSelectedVertex(Point point) |
Inserts point after the currently selected vertex programmatically. Requires a vertex to be selected. Returns whether the insertion was successful.
A lightweight check to see if the current Geometry of this SketchEditor can produce a valid geometry. Returns true
if:
- It is a Point and contains non-NaN x and y coordinates
- It is a Multipoint and contains at least one valid vertex
- It is a Polyline with at least
2
valid vertices in each part, and at least one part - It is a Polygon with at least
3
valid vertices in each part, and at least one part - It is an Envelope and it contains non-NaN xmin, ymin, xmax, and ymax-coordinates
bool moveSelectedVertex(Point point) |
Moves the selected vertex to point programmatically. Requires a vertex to be selected. Returns whether the move was successful.
Removes the currently selected vertex programmatically. Requires a vertex to be selected. Returns whether the removal was successful.
bool replaceGeometry(Geometry geometry) |
Replaces the entire sketch geometry with geometry programmatically. Returns whether the replace was successful.
Starts an empty sketch of type based on the provided creationMode.
The sketch editor begins responding to user interactions with the MapView to perform the sketch. Returns whether startCreationMode was successful.
bool startWithCreationModeAndEditConfiguration(Enums.SketchCreationMode creationMode, SketchEditConfiguration editConfiguration) |
Starts an empty sketch of geometry type based on the provided creationMode, with capabilities based on provided editConfiguration.
The sketch editor begins responding to user interactions with the MapView to perform the sketch. Depending on how the SketchEditConfiguration is configured, the Sketcheditor will exhibit different behaviours and capabilites.
Returns whether startWithCreationModeAndEditConfiguration was successful.
bool startWithGeometry(Geometry geometry) |
Starts a sketch based on the provided geometry.
The sketch editor begins responding to user interactions with the MapView to perform the sketch. The creationMode defaults to SketchCreationMode.Point, SketchCreationMode.Polyline, or SketchCreationMode.Polygon depending upon the type of geometry provided.
Returns whether startWithGeometry was successful.
bool startWithGeometryAndCreationMode(Geometry geometry, Enums.SketchCreationMode creationMode) |
Starts a sketch based on the provided geometry.
The sketch editor begins responding to user interactions with the MapView to perform the sketch. Returns whether startWithGeometryAndCreationMode was successful.
Note: geometry can be null, equivalent to call SketchEditor::startWithCreationMode.
Note: creationMode must correspond to the type of geometry, or start will fail and this method will return false
.
bool startWithGeometryCreationModeAndEditConfiguration(Geometry geometry, Enums.SketchCreationMode creationMode, SketchEditConfiguration editConfiguration) |
Starts a sketch based on the provided geometry , creationMode and editConfiguration.
The sketch editor begins responding to user interactions with the MapView to perform the sketch. Depending on how the SketchEditConfiguration is configured, the sketch editor will exhibit different behaviours and capabilites.
Returns whether startWithGeometryCreationModeAndEditConfiguration was successful.
Note: geometry can be null, equivalent to call SketchEditor::startWithCreationModeAndEditConfiguration.
Note: creationMode must correspond to the type of geometry, or start will fail and this method will return false
.
Stops the sketch by making the sketch editor no longer respond to user interaction.
This also clears the SketchEditor::geometry.