當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


JavaScript ArcGIS FeatureSnappingLayerSource用法及代碼示例


基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/views/interactive/snapping/FeatureSnappingLayerSource"], (FeatureSnappingLayerSource) => { /* code goes here */ });

ESM: import FeatureSnappingLayerSource from "@arcgis/core/views/interactive/snapping/FeatureSnappingLayerSource";

類: esri/views/interactive/snapping/FeatureSnappingLayerSource

繼承: FeatureSnappingLayerSource > Accessor

自從:用於 JavaScript 4.19 的 ArcGIS API

用法說明

FeatureSnappingLayerSource 指定哪些層將用於在 SnappingOptions 中進行捕捉。

已知限製

例子:

// 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 }]
  }
});

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 FeatureSnappingLayerSource。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。