<?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 Re: Enable all layers for snapping in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553194#M85986</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;, i see, i did not try to add FLs as objects and map.allLayers i couldn't think about it.&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 11:22:55 GMT</pubDate>
    <dc:creator>Vakhtang_Zubiashvili</dc:creator>
    <dc:date>2024-10-29T11:22:55Z</dc:date>
    <item>
      <title>Enable all layers for snapping</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553133#M85983</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;In edit widget i want to enable all layers snapping, i used this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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: myFlLayer1, myflLayer2, enabled: true }]
  }&lt;/LI-CODE&gt;&lt;P&gt;but, it des not work.&lt;/P&gt;&lt;P&gt;How can i pass several layers in &lt;STRONG&gt;featureSources&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 06:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553133#M85983</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2024-10-29T06:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Enable all layers for snapping</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553193#M85985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/107000"&gt;@Vakhtang_Zubiashvili&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You need to have a collection of &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-interactive-snapping-FeatureSnappingLayerSource.html" target="_self"&gt;FeatureSnappingLayerSource&lt;/A&gt;&amp;nbsp;. So with three layers (the second one is not enabled) it might look something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;featureSources: [{ layer: myFlLayer0, enabled: true }, { layer: myFlLayer1, enabled: false}, { layer: myFlLayer2, enabled: true }]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you really want to enable snapping on &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#allLayers" target="_self"&gt;all layers&lt;/A&gt; in your map you could probably do something like this but I haven't checked to see if this actually works.&amp;nbsp; I think it should, but you might have to filter the allLayers collection first to just the layer types supported in featureSources&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;  snappingOptions: { 
    enabled: true, 
    featureSources: map.allLayers
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 11:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553193#M85985</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-10-29T11:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Enable all layers for snapping</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553194#M85986</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;, i see, i did not try to add FLs as objects and map.allLayers i couldn't think about it.&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 11:22:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/enable-all-layers-for-snapping/m-p/1553194#M85986</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2024-10-29T11:22:55Z</dc:date>
    </item>
  </channel>
</rss>

