ArcGIS Runtime SDK for iOS
100.15
|
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.
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 |
AGSSketchEditConfiguration * | editConfiguration |
AGSGeometry * | geometry |
float | opacity |
AGSSketchVertex * | selectedVertex |
BOOL | sketchValid |
BOOL | started |
AGSSketchStyle * | style |
NSUndoManager * | undoManager |
BOOL | visible |
- (void) clearGeometry |
Clears the current geometry. This is an undo-able operation.
- (BOOL) insertVertexAfterSelectedVertexWithPoint: | (AGSPoint *) | point |
Adds a new vertex, and selects it. If geometry is empty, this adds a new point.
- (BOOL) moveSelectedVertexToPoint: | (AGSPoint *) | point |
Moves selected vertex
- (BOOL) removeSelectedVertex |
Removes the selected vertex
- (void) replaceGeometry: | (AGSGeometry *) | geometry |
Replaces the current geometry with geometry
. These geometries must be matching in type. This is an undo-able operation.
geometry | The new geometry to be used. |
+ (instancetype) sketchEditor |
- (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.
creationMode | representing the type of geometry that the user can sketch, and what type of user interaction will be used to create it. |
- (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.
creationMode | The type of geometry that the user can sketch and what type of user interaction will be used to create it. |
editConfiguration | specifying which options and interactions are supported to edit the geometry |
- (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.
geometry | to start the sketch with |
- (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.
geometry | to use as a starting point to begin the sketch with |
creationMode | representing 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 |
- (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.
geometry | to use as a starting point to begin the sketch with |
creationMode | representing 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 |
editConfiguration | specifying which options and interactions are supported to edit the geometry |
- (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.
geometryType | the type of geometry that the user can create |
- (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
.
|
readnonatomicassign |
Mode specifying which type of geometry will be sketched and what type of user interaction is used to create it.
|
readwritenonatomicstrong |
Specifies which options and interactions are supported to edit 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.
|
readwritenonatomicassign |
Opacity of the sketch
|
readwritenonatomicstrong |
The vertex of the geometry that is currently selected (if any)
|
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:
AGSPoint
must contain non-NaN x,y coordinates.AGSMultipoint
must contain at least one valid AGSPoint
.AGSPolyline
must contain at least one AGSPart
with two valid AGSPoint
.AGSPolygon
must contain at least one AGSPart
with three valid AGSPoint
.AGSEnvelope
must contain non-NaN minimum and maximum x and y values.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.
YES
if the sketch's geometry is valid.
|
readnonatomicassign |
Indicates whether the sketch editor is started and will respond to user interactions with the view.
|
readwritenonatomicstrong |
Visual appearance of the sketch
|
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.
|
readwritenonatomicassign |
Indicates whether the sketch will be visible or not