Skip to content
import FeatureSnappingLayerSource from "@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource.js";
Inheritance:
FeatureSnappingLayerSourceAccessor
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
ParameterTypeDescriptionRequired
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.
PropertyTypeClass
declaredClass
readonly inherited
layer
readonly
T

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

enabled

Property
Type
boolean

Indicates whether feature snapping is turned on or off.

Default value
true

layer

readonly Property
Type
T

The source layer used for snapping.

See also