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 when the pointer is
close to an existing snappable graphic or feature, the position of the interactive edit is adjusted
to coincide with ("snap to") that graphic or feature. When the edit position has been adjusted, visual cues show the user
the user the adjusted edit position, and which aspect of the feature geometry was used as the best candidate for that
adjustment.
To use snapping in the GeometryEditor:
- Connect a GeometryEditor to a map view using GeometryEditor, and ensure the Map
and any layers in it are loaded.
- Only layers that provide full resolution geometries can be used for snapping.
- Get the SnapSettings, set IsEnabled to
true
, and call SyncSourceSettings(). - 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 SyncSourceSettings() to populate the collection of sources. You can also call this method to refresh the collection as required, preserving the state of any existing SnapSourceSettings.
- Call one of the start methods on GeometryEditor to allow the end user to create or edit a new geometry by choosing to snap to the specified snapping sources.
You can snap to ISnapSource objects that are contained in the MapView associated with the GeometryEditor, and are visible. As snapping is used 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, 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, |
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.5 |
.NET | 200.4 - 200.5 |
.NET Windows | 200.4 - 200.5 |
.NET Android | 200.4 - 200.5 |
.NET iOS | 200.4 - 200.5 |
.NET Framework | 200.4 - 200.5 |
UWP | 200.4 - 200.5 |