<?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 Code Review: whenAllLayerViewsReady in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/code-review-whenalllayerviewsready/m-p/1644663#M87545</link>
    <description>&lt;P&gt;It's documentation day at the Office, and I wanted to share a small codepen sample which I'm open to any code review! We have some large map services that can sometimes take a while to load, and it would be nice to provide a visual indicator to users that the map is loading (those little dots in the Layer List aren't cutting it).&amp;nbsp; So, my sample is designed to watch each of the map.layerViews.updating properties, and to wait until all of the .updating properties are false to 'hide' a calcite-loader (and to show it again if any .updating turns true).&lt;BR /&gt;&lt;BR /&gt;Codepen: &lt;A href="https://codepen.io/Dane-Atkins/pen/wBKjXbX" target="_blank"&gt;whenAllLayerViewsReady&lt;/A&gt;&lt;BR /&gt;(draw your eyes to the top-right of the map as you zoom in and out of Manhattan...)&lt;/P&gt;&lt;P&gt;For some additional background, checkout this original video from 2017 that walks through the sequence of events from mapView to layerView.&amp;nbsp; The sequence is mostly the same today, but the exact watchUtils from that demonstration are now deprecated.&amp;nbsp;&lt;A href="https://odoe.net/blog/quick-tip-arcgis-api-4-js-stuff-ready/" target="_blank"&gt;Quick Tip: ArcGIS API 4 for JS - When stuff is ready?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Even so, that video was relevant when another Community Question asked about watching&amp;nbsp;&lt;EM&gt;multiple&amp;nbsp;&lt;/EM&gt;layers:&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-featurelayer-done-drawing/m-p/548913#M51086" target="_blank"&gt;Solved: Re: When featurelayer done drawing - Esri Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But that sample relied on hard-coding feature layers and arrays: I wanted a utility to work on any map with any number of layers (especially maps with lots of layers,&amp;nbsp;as the usefulness of this bit of code increases with more layers and longer load times!)&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please do share if there's anything in the sample that could be tightened up!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Aug 2025 13:45:29 GMT</pubDate>
    <dc:creator>D_Atkins</dc:creator>
    <dc:date>2025-08-22T13:45:29Z</dc:date>
    <item>
      <title>Code Review: whenAllLayerViewsReady</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/code-review-whenalllayerviewsready/m-p/1644663#M87545</link>
      <description>&lt;P&gt;It's documentation day at the Office, and I wanted to share a small codepen sample which I'm open to any code review! We have some large map services that can sometimes take a while to load, and it would be nice to provide a visual indicator to users that the map is loading (those little dots in the Layer List aren't cutting it).&amp;nbsp; So, my sample is designed to watch each of the map.layerViews.updating properties, and to wait until all of the .updating properties are false to 'hide' a calcite-loader (and to show it again if any .updating turns true).&lt;BR /&gt;&lt;BR /&gt;Codepen: &lt;A href="https://codepen.io/Dane-Atkins/pen/wBKjXbX" target="_blank"&gt;whenAllLayerViewsReady&lt;/A&gt;&lt;BR /&gt;(draw your eyes to the top-right of the map as you zoom in and out of Manhattan...)&lt;/P&gt;&lt;P&gt;For some additional background, checkout this original video from 2017 that walks through the sequence of events from mapView to layerView.&amp;nbsp; The sequence is mostly the same today, but the exact watchUtils from that demonstration are now deprecated.&amp;nbsp;&lt;A href="https://odoe.net/blog/quick-tip-arcgis-api-4-js-stuff-ready/" target="_blank"&gt;Quick Tip: ArcGIS API 4 for JS - When stuff is ready?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Even so, that video was relevant when another Community Question asked about watching&amp;nbsp;&lt;EM&gt;multiple&amp;nbsp;&lt;/EM&gt;layers:&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-featurelayer-done-drawing/m-p/548913#M51086" target="_blank"&gt;Solved: Re: When featurelayer done drawing - Esri Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But that sample relied on hard-coding feature layers and arrays: I wanted a utility to work on any map with any number of layers (especially maps with lots of layers,&amp;nbsp;as the usefulness of this bit of code increases with more layers and longer load times!)&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please do share if there's anything in the sample that could be tightened up!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 13:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/code-review-whenalllayerviewsready/m-p/1644663#M87545</guid>
      <dc:creator>D_Atkins</dc:creator>
      <dc:date>2025-08-22T13:45:29Z</dc:date>
    </item>
  </channel>
</rss>

