<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcGIS JS API Sketch snappingOptions is not reacting to featureSources in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-sketch-snappingoptions-is-not/m-p/1183033#M77682</link>
    <description>&lt;P&gt;I'm trying to set the Snapping options of the sketch widget, to snap only to a specific graphic layer, and not all others. It seems like the results " ignores" my settings, shows all the graphic layers, and do no enable the one io selected.&lt;/P&gt;&lt;P&gt;I used this example:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-snapping-magnifier/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sketch-snapping-magnifier/&lt;/A&gt;&lt;A href="https://tommypetportugal.com" target="_self"&gt;tommypet&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;export const createSketchWidget = (view, layer, onSketchUpdated, featureLayer) =&amp;gt; {
  const { Sketch } = getEsriModules();
  console.log('createSketchWidget', featureLayer);
  const sketchWidget = new Sketch({
    layer,
    view,
    creationMode: 'update',
    snappingOptions: {
      enabled: true,
      featureSources: [{ layer: featureLayer, enabled: true }],
    },
    visibleElements: {
      createTools: {
        circle: false,
        polyline: false,
        point: false,
        rectangle: true,
        polygon: true,
      },
      selectionTools: {
        'rectangle-selection': false,
        'lasso-selection': false,
      },
      snappingControlsElements: {
        header: true,
        layerList: true,
      },
      settingsMenu: true,
    },
  });

  view.ui.add(sketchWidget, 'top-right');
  sketchWidget.on('create', onSketchUpdated);
  sketchWidget.on('update', onSketchUpdated);

  return sketchWidget;
};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Jul 2022 10:02:28 GMT</pubDate>
    <dc:creator>AmirKhanInd</dc:creator>
    <dc:date>2022-07-04T10:02:28Z</dc:date>
    <item>
      <title>ArcGIS JS API Sketch snappingOptions is not reacting to featureSources</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-sketch-snappingoptions-is-not/m-p/1183033#M77682</link>
      <description>&lt;P&gt;I'm trying to set the Snapping options of the sketch widget, to snap only to a specific graphic layer, and not all others. It seems like the results " ignores" my settings, shows all the graphic layers, and do no enable the one io selected.&lt;/P&gt;&lt;P&gt;I used this example:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-snapping-magnifier/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sketch-snapping-magnifier/&lt;/A&gt;&lt;A href="https://tommypetportugal.com" target="_self"&gt;tommypet&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;export const createSketchWidget = (view, layer, onSketchUpdated, featureLayer) =&amp;gt; {
  const { Sketch } = getEsriModules();
  console.log('createSketchWidget', featureLayer);
  const sketchWidget = new Sketch({
    layer,
    view,
    creationMode: 'update',
    snappingOptions: {
      enabled: true,
      featureSources: [{ layer: featureLayer, enabled: true }],
    },
    visibleElements: {
      createTools: {
        circle: false,
        polyline: false,
        point: false,
        rectangle: true,
        polygon: true,
      },
      selectionTools: {
        'rectangle-selection': false,
        'lasso-selection': false,
      },
      snappingControlsElements: {
        header: true,
        layerList: true,
      },
      settingsMenu: true,
    },
  });

  view.ui.add(sketchWidget, 'top-right');
  sketchWidget.on('create', onSketchUpdated);
  sketchWidget.on('update', onSketchUpdated);

  return sketchWidget;
};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 10:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-sketch-snappingoptions-is-not/m-p/1183033#M77682</guid>
      <dc:creator>AmirKhanInd</dc:creator>
      <dc:date>2022-07-04T10:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JS API Sketch snappingOptions is not reacting to featureSources</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-sketch-snappingoptions-is-not/m-p/1186783#M77778</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/579559"&gt;@AmirKhanInd&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Have you had an opportunity to test with the latest version of the JSAPI 4.24, and are you using GroupLayers in your map? I ask because we had a similar issue we resolved for GroupLayers only, in version 4.24. I just tested and verified this is working with standalone layers. Here is the codepen I used from the same sample you provided:&lt;BR /&gt;&lt;A href="https://codepen.io/banuelosj/pen/KKoPGba?editors=1010" target="_blank"&gt;https://codepen.io/banuelosj/pen/KKoPGba?editors=1010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Your code looked fine on first glance, but if you still see the issue, feel free to use a similar codepen to the one I provided to provide a repro case.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 18:19:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-api-sketch-snappingoptions-is-not/m-p/1186783#M77778</guid>
      <dc:creator>JoseBanuelos</dc:creator>
      <dc:date>2022-06-28T18:19:02Z</dc:date>
    </item>
  </channel>
</rss>

