require(["esri/views/interactive/snapping/FeatureSnappingLayerSource"], function(FeatureSnappingLayerSource) { /* code goes here */ });
Class: esri/views/interactive/snapping/FeatureSnappingLayerSource
Inheritance: FeatureSnappingLayerSource Accessor
Since: ArcGIS API 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 include: FeatureLayer, GraphicsLayer, GeoJSONLayer, and CSVLayer.
  • Snapping is not yet implemented when updating existing 2D point geometries. For example, selecting an existing point and modifying it to snap to another will not currently work.
See also:
// 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,
    featureSources: [{ layer: graphicsLayer }] // autocasts to FeatureSnappingLayerSource()


new FeatureSnappingLayerSource(properties)
properties Object

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The name of the class.

more details
more detailsAccessor

Indicates whether feature snapping is turned on or off.

more details
more detailsFeatureSnappingLayerSource

The source layer used for snapping.

more details
more detailsFeatureSnappingLayerSource

Property Details

declaredClass Stringreadonly inherited

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

enabled Boolean

Indicates whether feature snapping is turned on or off.

Default Value:true

The source layer used for snapping.

See also: