<?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: Check if feature layer can be added before adding in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1260372#M80329</link>
    <description>&lt;P&gt;close&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/658399"&gt;@Christer&lt;/a&gt;&amp;nbsp;, no need for whenOnce().&lt;/P&gt;&lt;P&gt;It ended up being along the lines of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;try {
   await layer.load();

   // execute rest of code
} catch (e) {
// manage exception
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 08:03:41 GMT</pubDate>
    <dc:creator>Aeseir</dc:creator>
    <dc:date>2023-02-22T08:03:41Z</dc:date>
    <item>
      <title>Check if feature layer can be added before adding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1257888#M80242</link>
      <description>&lt;P&gt;Is there any way to determine if a feature layer can be accessed by the map before adding it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In cases where a layer is a protected resource, I don't want it sitting in the layerlist with a warning that it is not accessable.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 09:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1257888#M80242</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2023-02-14T09:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Check if feature layer can be added before adding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1258482#M80266</link>
      <description>&lt;P&gt;Hi, you can manually try load the layer before adding it to the map. if im not mistaken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import { whenOnce } from '@arcgis/core/core/reactiveUtils';

myLayer = new FeatureLayer(..)
whenOnce(() =&amp;gt; myLayer.loaded == true).then(() =&amp;gt; {
      console.log('All good');
      view.map.add(myLayer);
    });
myLayer.load();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 15:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1258482#M80266</guid>
      <dc:creator>Christer</dc:creator>
      <dc:date>2023-02-15T15:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check if feature layer can be added before adding</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1260372#M80329</link>
      <description>&lt;P&gt;close&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/658399"&gt;@Christer&lt;/a&gt;&amp;nbsp;, no need for whenOnce().&lt;/P&gt;&lt;P&gt;It ended up being along the lines of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;try {
   await layer.load();

   // execute rest of code
} catch (e) {
// manage exception
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 08:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/check-if-feature-layer-can-be-added-before-adding/m-p/1260372#M80329</guid>
      <dc:creator>Aeseir</dc:creator>
      <dc:date>2023-02-22T08:03:41Z</dc:date>
    </item>
  </channel>
</rss>

