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

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 (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 geometry 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
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

Indicates whether the sketch's geometry is valid. It is valid if :

  • It is a point and contains x & y coordinates.
  • It is a polyline and contains atleast one part of 2 or more vertices.
  • It is a polygon and contains atleast one part of 3 or more vertices which form a closed ring.
  • It is a multipoint and contains atleast one vertex.
  • It is an envelope and it contains xmin, ymin, xmax, & ymax coordinates.
Returns
YES if the sketch's geometry is valid.
Since
100

§ 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