import FeatureSnappingLayerSource from "@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource.js";const FeatureSnappingLayerSource = await $arcgis.import("@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource.js");- Inheritance:
- FeatureSnappingLayerSource→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.19
The FeatureSnappingLayerSource specifies which layers will be utilized for snapping in the SnappingOptions.
Known Limitations
Layer types currently supported for snapping are: FeatureLayer, GraphicsLayer (except Mesh geometries), GeoJSONLayer, WFSLayer, CSVLayer, SubtypeSublayer (2D only), MapNotesLayer (2D only), 3D Object SceneLayer (3D only), and BuildingSceneLayer (3D only).
- See also
Example
// Create a new instance of Sketch, and set// a layer for one of the featureSources property.// This enables feature snapping on that layer.const Sketch = new Sketch({ layer: graphicsLayer, view: view, snappingOptions: { // autocasts to SnappingOptions() enabled: true, // global snapping is turned on // assigns a collection of FeatureSnappingLayerSource() and enables feature snapping on this layer featureSources: [{ layer: graphicsLayer, enabled: true }] }});Constructors
Constructor
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
See the properties table for a list of all the
properties that may be passed into the constructor.
Properties
Any properties can be set, retrieved or listened to. See the
Watch for changes
topic.
enabled
Property
- Type
- boolean
Indicates whether feature snapping is turned on or off.
- Default value
- true