geometry property
The current geometry, updated as you interact with the view.
The geometry returned depends on the state of the GeometryEditor:
- Returns null while GeometryEditor.isStarted is false.
- Returns an empty geometry (Geometry.isEmpty is true) immediately after the GeometryEditor was started using GeometryEditor.startWithGeometryType.
- Returns the input geometry immediately after the GeometryEditor was started using GeometryEditor.startWithGeometry.
- Returns the current geometry while the GeometryEditor is in use (GeometryEditor.isStarted is true).
If the GeometryEditor was started by calling GeometryEditor.startWithGeometry, then the geometry is returned in the same SpatialReference as the input geometry. If the input geometry spatial reference is null, or the editor was started using GeometryEditor.startWithGeometryType, then the geometry is returned in the spatial reference of the associated ArcGISMapViewController. If no spatial reference is set on either input geometry or via an associated map view, then the spatial reference of the geometry will be null.
Editing feature data that is reprojected on the fly can introduce spatial errors into the data. When accuracy is important, best practice is to use a spatial reference for the map view which matches the feature layer geometry you are editing. The ArcGIS Pro editing help topic Introduction to projection on the fly contains further advice.
The value of GeometryEditor.geometry changes, raising the GeometryEditor.onGeometryChanged, when:
- starting or stopping the geometry editor - for example using GeometryEditor.startWithGeometryType or GeometryEditor.stop
- performing programmatic edits - for example using GeometryEditor.insertVertex or GeometryEditor.deleteSelectedElement
- performing interactive edits - for example adding or moving a vertex
- undoing or redoing edits - using GeometryEditor.undo or GeometryEditor.redo
Implementation
Geometry? get geometry {
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEditor_getGeometry(
_handle,
errorHandler,
);
});
return Geometry._fromHandle(
objectHandle,
);
}