SnapSettings

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:

To use snapping in the GeometryEditor:

You can snap to SnapSource objects that are contained in the com.arcgismaps.mapping.view.MapView 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.

Since

200.4.0

See also

Constructors

Link copied to clipboard
constructor()

Creates a default SnapSettings.

Properties

Link copied to clipboard

True to allow interactive snapping, based on the configured SnapSettings.sourceSettings, false otherwise. Default is false. If SnapSettings.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. The content of SnapSettings.sourceSettings determines which sources of geometries can be used to snap to.

Link copied to clipboard

True to allow interactive snapping to other features and graphics, based on the configured SnapSettings.sourceSettings, false otherwise. Default is true. Ignored if SnapSettings.isEnabled is false.

Link copied to clipboard

True to allow interactive snapping relative to the current GeometryEditor.geometry, false otherwise. Default is false. When enabled, additional visual cues appear as temporary guides when interactively editing polygon or polyline geometries, allowing edits to be snapped to:

Link copied to clipboard

True to enable haptic feedback whenever a snap occurs (if supported by the device), false otherwise. Enables haptic feedback whenever a snap occurs to a feature or graphic from a com.arcgismaps.mapping.view.geometryeditor.SnapSource, or geometry guide.

Link copied to clipboard

Defines the collection of snapping sources and whether or not each is enabled for snapping. Call SnapSettings.syncSourceSettings to populate this collection with a SnapSourceSettings for each valid SnapSource present in the connected com.arcgismaps.mapping.view.MapView. SnapSettings is connected to a com.arcgismaps.mapping.view.MapView via GeometryEditor.snapSettings, and com.arcgismaps.mapping.view.MapView.geometryEditor. If there is no connected com.arcgismaps.mapping.view.MapView, or the map view and the associated map contains no valid SnapSource objects, then the collection will be empty after SnapSettings.syncSourceSettings returns.

Functions

Link copied to clipboard

Synchronizes the SnapSettings.sourceSettings collection based on SnapSource objects in the currently connected com.arcgismaps.mapping.ArcGISMap. Call this method to populate SnapSettings.sourceSettings with a SnapSourceSettings for each valid SnapSource present in the com.arcgismaps.mapping.view.MapView currently connected to this SnapSettings via GeometryEditor.snapSettings, and com.arcgismaps.mapping.view.MapView.geometryEditor. If there is no connected com.arcgismaps.mapping.view.MapView, or the map view and the associated map contains no SnapSource objects valid for snapping, then the collection will be empty after this method returns.