syncSourceSettings
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.
The order of SnapSourceSettings objects will match the order that the associated SnapSource objects appear in the com.arcgismaps.mapping.ArcGISMap.operationalLayers and com.arcgismaps.mapping.view.MapView.graphicsOverlays collections, with objects from com.arcgismaps.mapping.ArcGISMap.operationalLayers appearing first, followed by com.arcgismaps.mapping.view.MapView.graphicsOverlays objects, in order. The collection will not contain a SnapSourceSettings for any loadable SnapSource which is not yet com.arcgismaps.LoadStatus.Loaded when SnapSettings.syncSourceSettings is called.
Subsequent calls will update the existing collection, accounting for SnapSource objects that have been added, removed, or moved since the last call to the same connected map. Any changes made to existing SnapSourceSettings objects, for example setting SnapSourceSettings.isEnabled, will be preserved.
Calling this method removes any rule-based snapping configuration that was previously set by calling SnapSettings.syncSourceSettings, and the SnapSourceSettings.ruleBehavior of all the SnapSourceSettings objects will be SnapRuleBehavior.None.
Since
200.4.0
See also
Throws
if the snap settings is shared between geometry editors connected to different maps
Synchronizes the SnapSettings.sourceSettings collection based on SnapSource objects in the currently connected com.arcgismaps.mapping.ArcGISMap and the given SnapRules which may affect each of them. Call this method to configure rule-based snapping. Similarly to SnapSettings.syncSourceSettings, this method will 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. In addition to populating the collection, the given SnapRules will be applied to each SnapSourceSettings, setting SnapSourceSettings.ruleBehavior appropriately for those rules. SnapRules are created by calling SnapRules.create, specifying a particular com.arcgismaps.utilitynetworks.UtilityAssetType that matches the feature whose geometry will be edited using the GeometryEditor. When editing features in a utility network, it is important to ensure that you have synchronized the snap sources with appropriate snap rules, so that the interactive snapping behavior is configured correctly for editing that asset type.
When using rule-based snapping, SnapSourceSettings.ruleBehavior may limit or prevent snapping to a snap source, regardless of its SnapSourceSettings.isEnabled value. Values of SnapSourceSettings.isEnabled will be affected by the given value of SnapSourceEnablingBehavior.
When rule-based snapping is configured, any edits made by interactively snapping to a SnapSource geometry will use the z-value of the feature geometry, if that snap source geometry is z-aware.
The SnapSettings.sourceSettings collection includes all valid snap sources in the map after synchronization, and therefore may include snap sources from data that is unrelated to the com.arcgismaps.utilitynetworks.UtilityNetwork given when creating the SnapRules, for example graphics overlays or feature layers from separate data sources. 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.
The order of SnapSourceSettings objects will match the order that the associated SnapSource objects appear in the com.arcgismaps.mapping.ArcGISMap.operationalLayers and com.arcgismaps.mapping.view.MapView.graphicsOverlays collections, with objects from com.arcgismaps.mapping.ArcGISMap.operationalLayers appearing first, followed by com.arcgismaps.mapping.view.MapView.graphicsOverlays objects, in order. The collection will not contain a SnapSourceSettings for any loadable SnapSource which is not yet com.arcgismaps.LoadStatus.Loaded when synchronization occurs.
Since
200.7.0
Parameters
The rules to apply to the SnapSource objects.
Whether to set SnapSourceSettings.isEnabled based on the given SnapRules, or preserve the existing values.
See also
Throws
When shared between multiple GeometryEditor.snapSettings properties, each GeometryEditor must be connected to the same ArcGISMap.