SnapSettings class final
Controls interactive snapping functionality for the GeometryEditor.
Snapping allows you to create geometries that connect to each other and are coincident, so that interactive edits are more accurate, with fewer errors.
If SnapSettings.isEnabled is true and a user edits a geometry interactively, then the position of the interactive edit is adjusted to coincide with ("snap to") other geometry edges (segments) or vertices. When the edit position has been adjusted, visual cues show the user the adjusted edit position, and which aspect of the referenced geometry was used as the best candidate for that adjustment. You can enable different types of snapping:
- SnapSettings.isFeatureSnappingEnabled allows snapping to other features or graphics.
- SnapSettings.isGeometryGuidesEnabled allows snapping to the current GeometryEditor.geometry.
To use snapping in the GeometryEditor:
- Connect a GeometryEditor to a map view using ArcGISMapViewController.geometryEditor.
- Get the GeometryEditor.snapSettings and set SnapSettings.isEnabled to true.
- To snap to other features or graphics in the map view:
- Ensure the ArcGISMapViewController.arcGISMap and any layers in it are loaded. Only layers that provide full resolution geometries can be used for snapping.
- Call SnapSettings.syncSourceSettings, and then set SnapSourceSettings.isEnabled to true for each SnapSource that you want users to be able to snap to. You may wish to enable all the SnapSourceSettings, use only select sources, or delegate the choice to your users.
- Call one of the start methods on GeometryEditor to allow the end user to create or edit a new geometry using the current SnapSettings.
- You can also call SnapSettings.syncSourceSettings to refresh the collection of snap sources at any time. The state of any existing SnapSourceSettings is preserved by this call.
You can snap to SnapSource objects that are contained in the ArcGISMapViewController associated with the GeometryEditor, and are visible. As snapping to SnapSource objects is done to maintain data integrity between different sources of data, only SnapSource objects that provide full resolution geometries can be used for snapping. See SnapSource for more information.
The visual cues that indicate to a user when snapping has occurred can be customized using GeometryEditorStyle.snappedToVertexSymbol and GeometryEditorStyle.snappedToLineSymbol. If there are multiple potential candidates that could be snapped to for a given pointer position, then GeometryEditorStyle.multipleSnapCandidatesSymbol is used to indicate this.
- Implemented types
Constructors
- SnapSettings()
-
Creates a default SnapSettings.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled ↔ bool
-
True to allow interactive snapping, based on the configured
SnapSettings.sourceSettings, false otherwise. Default is false.
getter/setter pair
- isFeatureSnappingEnabled ↔ bool
-
True to allow interactive snapping to other features and graphics, based
on the configured SnapSettings.sourceSettings, false otherwise. Default
is true.
getter/setter pair
- isGeometryGuidesEnabled ↔ bool
-
True to allow interactive snapping relative to the current
GeometryEditor.geometry, false otherwise. Default is false.
getter/setter pair
- isHapticFeedbackEnabled ↔ bool
-
True to enable haptic feedback whenever a snap occurs (if supported by the
device), false otherwise.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sourceSettings
→ List<
SnapSourceSettings> -
Defines the collection of snapping sources and whether or not each is
enabled for snapping.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
syncSourceSettings(
) → void - Synchronizes the SnapSettings.sourceSettings collection based on SnapSource objects in the currently connected ArcGISMap.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited