Snap Source
Indicates a source of geometries that a GeometryEditor could snap interactive edits to. SnapSource is implemented by objects that can provide a source of geometries to snap interactive edits to when using the GeometryEditor. For example, a feature layer or graphics overlay can provide a set of geometries that you may want your users to snap to.
Following a call to SnapSettings.syncSourceSettings, the SnapSettings.sourceSettings collection is populated with SnapSourceSettings objects that are valid for snapping. Each represents a SnapSource that is in the currently connected map, is suitable for snapping, and is loaded. For each SnapSource you want to allow snapping to, set the corresponding SnapSourceSettings.isEnabled to true.
Snapping is used to maintain data integrity between different sources of data when editing, so it is important that each SnapSource provides full resolution geometries to be valid for snapping. This means that some of the default optimizations used to improve the efficiency of data transfer and display of polygon and polyline layers based on feature services are not appropriate for use with snapping. To snap to polygon and polyline layers based on a com.arcgismaps.data.ServiceFeatureTable, the recommended approach is to ensure the following properties are configured before the layer is loaded:
Set the feature tiling mode to com.arcgismaps.mapping.layers.FeatureTilingMode.EnabledWithFullResolutionWhenSupported, and
Use the default feature request mode com.arcgismaps.data.FeatureRequestMode.OnInteractionCache
You can configure these properties on a per-layer basis using com.arcgismaps.mapping.layers.FeatureLayer.tilingMode and com.arcgismaps.data.ServiceFeatureTable.featureRequestMode, or for a whole com.arcgismaps.mapping.ArcGISMap using com.arcgismaps.mapping.LoadSettings.featureRequestMode and com.arcgismaps.mapping.LoadSettings.featureTilingMode.
Layers and graphics overlays providing a valid source of geometries for snapping are represented by a corresponding SnapSourceSettings object in the SnapSettings.sourceSettings collection after SnapSettings.syncSourceSettings returns.
Alternative approaches to create a valid snappable layer for polygon or polyline hosted feature layers are to:
Disable feature tiling using com.arcgismaps.mapping.layers.FeatureTilingMode.Disabled, and use com.arcgismaps.data.FeatureRequestMode.OnInteractionCache.
Use com.arcgismaps.data.FeatureRequestMode.ManualCache with any feature tiling mode.
If your app sets com.arcgismaps.ArcGISEnvironment.serviceCurveGeometryMode to com.arcgismaps.ServiceCurveGeometryMode.TrueCurveClient to fetch true curves, you should consider using one of these alternatives. Curve geometries are not currently supported in the PBF format used by feature tile requests, and densified curves are returned from the service if feature tiling is used. Using these alternatives will ensure that true curves are preserved in a SnapSource based on a feature service.
Local data sources, such as geodatabases, always provide full resolution geometries. Point and multipoint feature layers are also always full resolution.
Since
200.4.0