Show / Hide Table of Contents

Class SnapSettings

Controls interactive snapping functionality for the GeometryEditor.

Inheritance
System.Object
SnapSettings
Implements
System.ComponentModel.INotifyPropertyChanged
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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.
    • Or call SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior), to configure rule-based snapping behavior to limit snaps based on connectivity rules stored in a utility network.
  • 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() or SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior) to refresh the collection of snap sources at any time.

You can snap to ISnapSource objects that are contained in the MapView associated with the GeometryEditor, and are visible. If you configured rule-based snapping, then the features that you can snap to will additionally be limited by the SnapRules you set.

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, false otherwise. Default is true.

IsGeometryGuidesEnabled

Gets or sets a value indicating whether to allow interactive snapping relative to the current Geometry, false otherwise. Default is true.

IsHapticFeedbackEnabled

Gets or sets a value indicating whether to enable haptic feedback whenever a snap occurs (if supported by the device), false otherwise.

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.

SyncSourceSettings(SnapRules, SnapSourceEnablingBehavior)

Synchronizes the SourceSettings collection based on ISnapSource objects in the currently connected Map and the SnapRules affecting them.

Events

Name Description
PropertyChanged

Occurs when a non-dependency property value changes.

See Also

GeometryEditor
ISnapSource
SnapSourceSettings
SnapRules

Applies to

TargetVersions
.NET Standard 2.0200.4 - 200.7
.NET200.4 - 200.7
.NET Windows200.4 - 200.7
.NET Android200.4 - 200.7
.NET iOS200.4 - 200.7
.NET Framework200.4 - 200.7
UWP200.4 - 200.7
In This Article
Back to top Copyright © 2022 Esri.