Class SnapSettings
Controls interactive snapping functionality for the GeometryEditor.
Inheritance
Implements
Namespace: Esri.ArcGISRuntime.UI.Editing
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class SnapSettings : INotifyPropertyChanged
Remarks
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 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:
- IsFeatureSnappingEnabled allows snapping to other features or graphics.
- IsGeometryGuidesEnabled allows snapping to the current Geometry.
To use snapping in the GeometryEditor:
- Connect a GeometryEditor to a map view using GeometryEditor.
- Get the SnapSettings and set IsEnabled to
true
. - To snap to other features or graphics in the map view:
- Ensure the Map and any layers in it are loaded. Only layers that provide full resolution geometries can be used for snapping.
-
Call SyncSourceSettings(), and then set IsEnabled to
true
for each ISnapSource 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 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 ISnapSource objects that are contained in the MapView associated with the GeometryEditor, and are visible. As snapping to ISnapSource objects is done to maintain data integrity between different sources of data, only ISnapSource objects that provide full resolution geometries can be used for snapping. See ISnapSource for more information.
The visual cues that indicate to a user when snapping has occurred can be customized using SnappedToVertexSymbol and SnappedToLineSymbol. If there are multiple potential candidates that could be snapped to for a given pointer position, then MultipleSnapCandidatesSymbol is used to indicate this.
Constructors
Name | Description |
---|---|
SnapSettings() | Initializes a new instance of the SnapSettings class. |
Properties
Name | Description |
---|---|
IsEnabled | Gets or sets a value indicating whether interactive geometry edits made using the GeometryEditor should happen using the current SnapSettings. |
IsFeatureSnappingEnabled | Gets or sets a value indicating whether to allow interactive snapping to other features and graphics, based on the configured SourceSettings, |
IsGeometryGuidesEnabled | Gets or sets a value indicating whether to allow interactive snapping relative to the current Geometry, |
IsHapticFeedbackEnabled | Gets or sets a value indicating whether to enable haptic feedback whenever a snap occurs (if supported by the device), |
SourceSettings | Gets the collection of snapping sources and whether or not each is enabled for snapping. |
Tolerance | Gets or sets a radius in device-independent pixels (DIP) that specifies how close the interactive edit position must be to the snapping source geometry in order to trigger the snap. |
Methods
Name | Description |
---|---|
SyncSourceSettings() | Synchronizes the SourceSettings collection based on ISnapSource objects in the currently connected Map. |
Events
Name | Description |
---|---|
PropertyChanged | Occurs when a non-dependency property value changes. |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 200.4 - 200.6 |
.NET | 200.4 - 200.6 |
.NET Windows | 200.4 - 200.6 |
.NET Android | 200.4 - 200.6 |
.NET iOS | 200.4 - 200.6 |
.NET Framework | 200.4 - 200.6 |
UWP | 200.4 - 200.6 |