<?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: Feature Layer takes a long time to load in JS 4.32 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1591129#M86611</link>
    <description>&lt;P&gt;Hi Val,&lt;BR /&gt;&lt;BR /&gt;Based on your code, my guess would be that you see a decreased performance due to one of the breaking changes to map components from the release:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/release-notes/#map-components-breaking-changes" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/release-notes/#map-components-breaking-changes&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;UL&gt;&lt;LI&gt;The&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-map/" target="_blank" rel="noopener"&gt;arcgis-map&lt;/A&gt;and&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/" target="_blank" rel="noopener"&gt;arcgis-scene&lt;/A&gt;components are no longer created with a default basemap. Use thebasemaporitem-idattribute to set the basemap on the component, or set theMapin JavaScript. Settingbasemap="none"is no longer valid; to create a map without a basemap simply avoid setting thebasemapattribute. Note that if you don't assign a basemap, thearcgisViewReadyChangeevent will not fire until the map's properties are updated.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Previously a default basemap would be loaded, and then the basemap you specified would be loaded afterwards. What that means for your code in 4.31 is that the call to fetch the feature layer and then add it to the map would actually execute before the final arcgisViewReadyChange event (it would have been triggered 2 or more times).&lt;BR /&gt;&lt;BR /&gt;I've modified your codePen with the below by instead forcing the featureLayer to load outside of the arcgisViewReadyChange event listener, only using it to actually add the layer onto the map. This seems to have decreased the load time pretty dramatically, at least in this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;ArcGIS Map SDK for JavaScript 4.32 test&amp;lt;/title&amp;gt;
  &amp;lt;style&amp;gt;
    html,
    body {
      background-color: var(--calcite-ui-foreground-2);
      padding: 0;
      margin: 0;
      width: 100vw;
      height: 100vh;
    }
  &amp;lt;/style&amp;gt;
  &amp;lt;!--   4.31 featureLayer loads quickly --&amp;gt;
&amp;lt;!--   &amp;lt;link rel='stylesheet' type='text/css' href='https://js.arcgis.com/calcite-components/2.13.2/calcite.css' /&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/calcite-components/2.13.2/calcite.esm.js'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel='stylesheet' href='https://js.arcgis.com/4.31/esri/themes/light/main.css' /&amp;gt;
  &amp;lt;script src='https://js.arcgis.com/4.31/'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/map-components/4.31/arcgis-map-components.esm.js'&amp;gt;&amp;lt;/script&amp;gt; --&amp;gt;
  
  &amp;lt;!-- 4.32 featureLayer takes a long time to load --&amp;gt;
  &amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/3.0.3/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.32/"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type="module" src="https://js.arcgis.com/map-components/4.32/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
  
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;arcgis-map basemap="topo-vector" center='-118.805, 34.027' zoom='4'&amp;gt;&amp;lt;/arcgis-map&amp;gt;
    &amp;lt;script&amp;gt;
      const arcgisMap = document.querySelector("arcgis-map");
      require([
        'esri/layers/FeatureLayer'
      ],(
        FeatureLayer
      ) =&amp;gt; {
          const featureLayer = new FeatureLayer({
            url: 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/WorldCities/FeatureServer/0',
            outFieilds: ['*']
          });
        
        featureLayer.load()
        arcgisMap.addEventListener("arcgisViewReadyChange", (event) =&amp;gt; {
        
          arcgisMap.map.add(featureLayer);
        });
      });    
    &amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2025 06:46:25 GMT</pubDate>
    <dc:creator>GeoGalvanic</dc:creator>
    <dc:date>2025-03-03T06:46:25Z</dc:date>
    <item>
      <title>Feature Layer takes a long time to load in JS 4.32</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589228#M86581</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm playing around with the new JS 4.32 but it seems slow to do certain things. I'm particularly baffled by the time it takes to add a simple Feature Layer to a basemap. Should I be doing it differently from how I did it in 4.31?&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/valcannon/pen/VYwKENQ" target="_self"&gt;https://codepen.io/valcannon/pen/VYwKENQ&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;ArcGIS Map SDK for JavaScript 4.32 test&amp;lt;/title&amp;gt;
  &amp;lt;style&amp;gt;
    html,
    body {
      background-color: var(--calcite-ui-foreground-2);
      padding: 0;
      margin: 0;
      width: 100vw;
      height: 100vh;
    }
  &amp;lt;/style&amp;gt;
  &amp;lt;!--   4.31 featureLayer loads quickly --&amp;gt;
  &amp;lt;link rel='stylesheet' type='text/css' href='https://js.arcgis.com/calcite-components/2.13.2/calcite.css' /&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/calcite-components/2.13.2/calcite.esm.js'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel='stylesheet' href='https://js.arcgis.com/4.31/esri/themes/light/main.css' /&amp;gt;
  &amp;lt;script src='https://js.arcgis.com/4.31/'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/map-components/4.31/arcgis-map-components.esm.js'&amp;gt;&amp;lt;/script&amp;gt;
  
  &amp;lt;!-- 4.32 featureLayer takes a long time to load --&amp;gt;
&amp;lt;!--   &amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/3.0.3/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.32/"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type="module" src="https://js.arcgis.com/map-components/4.32/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt; --&amp;gt;
  
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;arcgis-map basemap="topo-vector" center='-118.805, 34.027' zoom='4'&amp;gt;&amp;lt;/arcgis-map&amp;gt;
    &amp;lt;script&amp;gt;
      const arcgisMap = document.querySelector("arcgis-map");
      require([
        'esri/layers/FeatureLayer'
      ],(
        FeatureLayer
      ) =&amp;gt; {
        arcgisMap.addEventListener("arcgisViewReadyChange", (event) =&amp;gt; {
          const featureLayer = new FeatureLayer({
            url: 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/WorldCities/FeatureServer/0',
            outFieilds: ['*']
          });
          arcgisMap.map.add(featureLayer);
        });
      });    
    &amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 00:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589228#M86581</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2025-02-26T00:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer takes a long time to load in JS 4.32</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589229#M86582</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 00:02:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589229#M86582</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2025-02-26T00:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer takes a long time to load in JS 4.32</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589231#M86583</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 00:03:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1589231#M86583</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2025-02-26T00:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer takes a long time to load in JS 4.32</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1591129#M86611</link>
      <description>&lt;P&gt;Hi Val,&lt;BR /&gt;&lt;BR /&gt;Based on your code, my guess would be that you see a decreased performance due to one of the breaking changes to map components from the release:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/release-notes/#map-components-breaking-changes" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/release-notes/#map-components-breaking-changes&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;UL&gt;&lt;LI&gt;The&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-map/" target="_blank" rel="noopener"&gt;arcgis-map&lt;/A&gt;and&lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/" target="_blank" rel="noopener"&gt;arcgis-scene&lt;/A&gt;components are no longer created with a default basemap. Use thebasemaporitem-idattribute to set the basemap on the component, or set theMapin JavaScript. Settingbasemap="none"is no longer valid; to create a map without a basemap simply avoid setting thebasemapattribute. Note that if you don't assign a basemap, thearcgisViewReadyChangeevent will not fire until the map's properties are updated.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Previously a default basemap would be loaded, and then the basemap you specified would be loaded afterwards. What that means for your code in 4.31 is that the call to fetch the feature layer and then add it to the map would actually execute before the final arcgisViewReadyChange event (it would have been triggered 2 or more times).&lt;BR /&gt;&lt;BR /&gt;I've modified your codePen with the below by instead forcing the featureLayer to load outside of the arcgisViewReadyChange event listener, only using it to actually add the layer onto the map. This seems to have decreased the load time pretty dramatically, at least in this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;ArcGIS Map SDK for JavaScript 4.32 test&amp;lt;/title&amp;gt;
  &amp;lt;style&amp;gt;
    html,
    body {
      background-color: var(--calcite-ui-foreground-2);
      padding: 0;
      margin: 0;
      width: 100vw;
      height: 100vh;
    }
  &amp;lt;/style&amp;gt;
  &amp;lt;!--   4.31 featureLayer loads quickly --&amp;gt;
&amp;lt;!--   &amp;lt;link rel='stylesheet' type='text/css' href='https://js.arcgis.com/calcite-components/2.13.2/calcite.css' /&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/calcite-components/2.13.2/calcite.esm.js'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel='stylesheet' href='https://js.arcgis.com/4.31/esri/themes/light/main.css' /&amp;gt;
  &amp;lt;script src='https://js.arcgis.com/4.31/'&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type='module' src='https://js.arcgis.com/map-components/4.31/arcgis-map-components.esm.js'&amp;gt;&amp;lt;/script&amp;gt; --&amp;gt;
  
  &amp;lt;!-- 4.32 featureLayer takes a long time to load --&amp;gt;
  &amp;lt;script type="module" src="https://js.arcgis.com/calcite-components/3.0.3/calcite.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.32/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.32/"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type="module" src="https://js.arcgis.com/map-components/4.32/arcgis-map-components.esm.js"&amp;gt;&amp;lt;/script&amp;gt;
  
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;arcgis-map basemap="topo-vector" center='-118.805, 34.027' zoom='4'&amp;gt;&amp;lt;/arcgis-map&amp;gt;
    &amp;lt;script&amp;gt;
      const arcgisMap = document.querySelector("arcgis-map");
      require([
        'esri/layers/FeatureLayer'
      ],(
        FeatureLayer
      ) =&amp;gt; {
          const featureLayer = new FeatureLayer({
            url: 'https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/WorldCities/FeatureServer/0',
            outFieilds: ['*']
          });
        
        featureLayer.load()
        arcgisMap.addEventListener("arcgisViewReadyChange", (event) =&amp;gt; {
        
          arcgisMap.map.add(featureLayer);
        });
      });    
    &amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 06:46:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1591129#M86611</guid>
      <dc:creator>GeoGalvanic</dc:creator>
      <dc:date>2025-03-03T06:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer takes a long time to load in JS 4.32</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1591229#M86613</link>
      <description>&lt;P&gt;Very good. This programming pattern will be applicable to several applications I'm working on. Thanks for the solution.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2025 15:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-takes-a-long-time-to-load-in-js-4-32/m-p/1591229#M86613</guid>
      <dc:creator>ValCannon2</dc:creator>
      <dc:date>2025-03-03T15:45:30Z</dc:date>
    </item>
  </channel>
</rss>

