ArcGIS Runtime SDK for iOS: AGSSketchEditor Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSSketchEditor Class Reference

Description

A class that allows the user to sketch geometries on the map.

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 (AGSMapView::sketchEditor) and then started to perform the sketch based on user interactions.

Since
100
Inheritance diagram for AGSSketchEditor:

Instance Methods

(void) - clearGeometry
 
(BOOL) - insertVertexAfterSelectedVertexWithPoint:
 
(BOOL) - moveSelectedVertexToPoint:
 
(BOOL) - removeSelectedVertex
 
(void) - replaceGeometry:
 
(BOOL) - startWithCreationMode:
 
(BOOL) - startWithCreationMode:editConfiguration:
 
(BOOL) - startWithGeometry:
 
(BOOL) - startWithGeometry:creationMode:
 
(BOOL) - startWithGeometry:creationMode:editConfiguration:
 
(BOOL) - startWithGeometryType:
 
(void) - stop
 

Class Methods

(instancetype) + sketchEditor
 

Properties

AGSSketchCreationMode creationMode
 
AGSSketchEditConfigurationeditConfiguration
 
AGSGeometrygeometry
 
float opacity
 
AGSSketchVertexselectedVertex
 
BOOL sketchValid
 
BOOL started
 
AGSSketchStylestyle
 
NSUndoManager * undoManager
 
BOOL visible
 

Method Documentation

◆ clearGeometry

- (void) clearGeometry

Clears the current geometry. This is an undo-able operation.

Since
100

◆ insertVertexAfterSelectedVertexWithPoint:

- (BOOL) insertVertexAfterSelectedVertexWithPoint: (AGSPoint *)  point

Adds a new vertex, and selects it. If geometry is empty, this adds a new point.

Since
100.2

◆ moveSelectedVertexToPoint:

- (BOOL) moveSelectedVertexToPoint: (AGSPoint *)  point

Moves selected vertex

Since
100.2

◆ removeSelectedVertex

- (BOOL) removeSelectedVertex

Removes the selected vertex

Since
100.2

◆ replaceGeometry:

- (void) replaceGeometry: (AGSGeometry *)  geometry

Replaces the current geometry with geometry. These geometries must be matching in type. This is an undo-able operation.

Parameters
geometryThe new geometry to be used.
Since
100

◆ sketchEditor

+ (instancetype) sketchEditor

◆ startWithCreationMode:

- (BOOL) startWithCreationMode: (AGSSketchCreationMode creationMode

Starts a sketch based on the provided creation mode. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch.

Parameters
creationModerepresenting the type of geometry that the user can sketch, and what type of user interaction will be used to create it.
Since
100

◆ startWithCreationMode:editConfiguration:

- (BOOL) startWithCreationMode: (AGSSketchCreationMode creationMode
editConfiguration: (nullable AGSSketchEditConfiguration *)  editConfiguration 

Starts a sketch based on the provided creation mode and edit configuration. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch.

Parameters
creationModeThe type of geometry that the user can sketch and what type of user interaction will be used to create it.
editConfigurationspecifying which options and interactions are supported to edit the geometry
Since
100.2

◆ startWithGeometry:

- (BOOL) startWithGeometry: (AGSGeometry *)  geometry

Starts a sketch based on the provided geometry. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch. The creationMode defaults to AGSSketchCreationModePoint, AGSSketchCreationModePolyline, or AGSSketchCreationModePolygon depending upon the type of geometry provided.

Parameters
geometryto start the sketch with
Since
100

◆ startWithGeometry:creationMode:

- (BOOL) startWithGeometry: (nullable AGSGeometry *)  geometry
creationMode: (AGSSketchCreationMode creationMode 

Starts a sketch based on the provided geometry and creation mode. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch.

Parameters
geometryto use as a starting point to begin the sketch with
creationModerepresenting the type of geometry that the user can sketch, and what type of user interaction will be used to create it. This must be compatible with the geometry being provided
Since
100

◆ startWithGeometry:creationMode:editConfiguration:

- (BOOL) startWithGeometry: (nullable AGSGeometry *)  geometry
creationMode: (AGSSketchCreationMode creationMode
editConfiguration: (nullable AGSSketchEditConfiguration *)  editConfiguration 

Starts a sketch based on the provided geometry, creation mode, and edit configuration. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch.

Parameters
geometryto use as a starting point to begin the sketch with
creationModerepresenting the type of geometry that the user can sketch, and what type of user interaction will be used to create it. This must be compatible with the geometry being provided
editConfigurationspecifying which options and interactions are supported to edit the geometry
Since
100.2

◆ startWithGeometryType:

- (BOOL) startWithGeometryType: (AGSGeometryType geometryType

Starts a sketch based on the provided geometry. The sketch editor begins responding to user interactions with the AGSGeoView to perform the sketch. The creationMode defaults to AGSSketchCreationModePoint, AGSSketchCreationModePolyline, or AGSSketchCreationModePolygon depending upon the type of geometry provided.

Parameters
geometryTypethe type of geometry that the user can create
Since
100

◆ stop

- (void) stop

Stops the sketch by making the sketch editor no longer respond to user interaction. This also clears the geometry and resets the undoManager.

Since
100

Property Documentation

◆ creationMode

- (AGSSketchCreationMode) creationMode
readnonatomicassign

Mode specifying which type of geometry will be sketched and what type of user interaction is used to create it.

Since
100

◆ editConfiguration

- (AGSSketchEditConfiguration*) editConfiguration
readwritenonatomicstrong

Specifies which options and interactions are supported to edit geometry

Since
100.2

◆ geometry

- (AGSGeometry*) geometry
readnonatomicstrong

The geometry currently being sketched. It is updated as the user interacts with the view. An AGSSketchEditorGeometryDidChangeNotification is posted whenever the geometry changes.

Since
100

◆ opacity

- (float) opacity
readwritenonatomicassign

Opacity of the sketch

Since
100

◆ selectedVertex

- (AGSSketchVertex*) selectedVertex
readwritenonatomicstrong

The vertex of the geometry that is currently selected (if any)

Since
100.2

◆ sketchValid

- (BOOL) sketchValid
readnonatomicassign

Check if a geometry contains sufficient points to show a valid graphical sketch.

This can be used as an initial lightweight check to see the current state of a AGSSketchEditor::geometry; for example, it may be used to enable or disable functionality in an editing user interface. The exact requirements vary depending on the type of geometry:

Note that this is not equivalent to topological simplicity, which is enforced by simplifyGeometry: (AGSGeometryEngine) and checked using geometryIsSimple: (AGSGeometryEngine). Geometries must be topologically simple to be successfully saved in a geodatabase, or used in some service operations.

Does not check the spatial reference. Will return NO if an error occurs.

Note
Prior to v100.8, only one part of a multipart polygon or polyline was required to have the minimum number (2 for a polyline, 3 for a polygon) of points.
Returns
YES if the sketch's geometry is valid.
Since
100.0

◆ started

- (BOOL) started
readnonatomicassign

Indicates whether the sketch editor is started and will respond to user interactions with the view.

Since
100

◆ style

- (AGSSketchStyle*) style
readwritenonatomicstrong

Visual appearance of the sketch

Since
100

◆ undoManager

- (NSUndoManager*) undoManager
readnonatomicstrong

A manager to undo/redo changes to the sketch geometry. This manager keeps track of all the changes performed through user interactions with the view.

Since
100

◆ visible

- (BOOL) visible
readwritenonatomicassign

Indicates whether the sketch will be visible or not

Since
100