<?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 LayerInfos and App Loading in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1116415#M21571</link>
    <description>&lt;P&gt;I'm working on customizing a widget and I need access to all of the layers and tables in the map to clear selections.&amp;nbsp; I was imitating other parts of Web AppBuilder and using LayerInfos.&amp;nbsp; I had no problem doing this with a custom class that was probably loaded later in the application loading process.&amp;nbsp; However, this time around I am having some issues.&amp;nbsp; Here is the code I am running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var layerInfosObj = LayerInfos.getInstanceSync();
var layerObjects = [];

layerInfosObj.getLayerInfoArray().forEach(function (layerInfo) {
  layerObjects.push(layerInfo.layerObject);
});

layerInfosObj.getTableInfoArray().forEach(function (tableInfo) {
  layerObjects.push(tableInfo.layerObject);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added this code to an event handler that subscribes to app/mapLoaded.&amp;nbsp; The layer objects I get from the layers are all fully built out.&amp;nbsp; The ones from the tables are somewhat empty objects.&amp;nbsp; If I run the same code after the app is fully loaded, the layer objects for the tables are complete.&amp;nbsp; I need the layer Objects for the tables to have the clearSelection method and they don't on app/mapLoaded.&lt;/P&gt;&lt;P&gt;Is there another topic I could subscribe to that occurs later?&amp;nbsp; I have no idea where to find documentation on these subscription topics.&amp;nbsp; I searched for app/mapLoaded elsewhere in the code and I could not find where it is published.&amp;nbsp; Therefore, I don't know how this works.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 17:18:36 GMT</pubDate>
    <dc:creator>NathanHeickLACSD</dc:creator>
    <dc:date>2021-11-12T17:18:36Z</dc:date>
    <item>
      <title>LayerInfos and App Loading</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1116415#M21571</link>
      <description>&lt;P&gt;I'm working on customizing a widget and I need access to all of the layers and tables in the map to clear selections.&amp;nbsp; I was imitating other parts of Web AppBuilder and using LayerInfos.&amp;nbsp; I had no problem doing this with a custom class that was probably loaded later in the application loading process.&amp;nbsp; However, this time around I am having some issues.&amp;nbsp; Here is the code I am running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var layerInfosObj = LayerInfos.getInstanceSync();
var layerObjects = [];

layerInfosObj.getLayerInfoArray().forEach(function (layerInfo) {
  layerObjects.push(layerInfo.layerObject);
});

layerInfosObj.getTableInfoArray().forEach(function (tableInfo) {
  layerObjects.push(tableInfo.layerObject);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added this code to an event handler that subscribes to app/mapLoaded.&amp;nbsp; The layer objects I get from the layers are all fully built out.&amp;nbsp; The ones from the tables are somewhat empty objects.&amp;nbsp; If I run the same code after the app is fully loaded, the layer objects for the tables are complete.&amp;nbsp; I need the layer Objects for the tables to have the clearSelection method and they don't on app/mapLoaded.&lt;/P&gt;&lt;P&gt;Is there another topic I could subscribe to that occurs later?&amp;nbsp; I have no idea where to find documentation on these subscription topics.&amp;nbsp; I searched for app/mapLoaded elsewhere in the code and I could not find where it is published.&amp;nbsp; Therefore, I don't know how this works.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 17:18:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1116415#M21571</guid>
      <dc:creator>NathanHeickLACSD</dc:creator>
      <dc:date>2021-11-12T17:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: LayerInfos and App Loading</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1117404#M21589</link>
      <description>&lt;P&gt;not a great solution, but a possible work around. The esri default Splash widget has events at the bottom that publish 'splashPopupShow' and 'splashPopupHide'. So if you have a splash widget,&amp;nbsp; you could try listening to that. The user might still click through it faster than it takes to get the map stuff loaded?&lt;/P&gt;&lt;P&gt;Also try googling for something like 'how to find out what javascript events are running'?&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/3787555/how-to-find-out-which-javascript-events-fired" target="_blank"&gt;https://stackoverflow.com/questions/3787555/how-to-find-out-which-javascript-events-fired&lt;/A&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 20:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1117404#M21589</guid>
      <dc:creator>EricRuberson1</dc:creator>
      <dc:date>2021-11-16T20:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: LayerInfos and App Loading</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1117457#M21590</link>
      <description>&lt;P&gt;Thanks, Eric.&amp;nbsp; I will look into that.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 21:44:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/layerinfos-and-app-loading/m-p/1117457#M21590</guid>
      <dc:creator>NathanHeickLACSD</dc:creator>
      <dc:date>2021-11-16T21:44:16Z</dc:date>
    </item>
  </channel>
</rss>

