<?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: Legend widget 4x: poor performance with many layers but only a few visible in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1305345#M81613</link>
    <description>&lt;P&gt;Yeah, I've thought about various ways I might be able delay construction of the legend until after complete rendering of the webmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still haven't landed on anything solid yet.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 15:08:46 GMT</pubDate>
    <dc:creator>Dirk_Vandervoort</dc:creator>
    <dc:date>2023-07-03T15:08:46Z</dc:date>
    <item>
      <title>Legend widget 4x: poor performance with many layers but only a few visible</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1302736#M81515</link>
      <description>&lt;P&gt;We are seeing ~25% performance degradation for JSAPI map applications that use a legend widget over the same map application that does not use a legend widget&amp;gt; This is observable when there are many layers and with only a few visible.&lt;/P&gt;&lt;P&gt;Has anybody else seen this behavior?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context&lt;/STRONG&gt;: ArcGIS Online hosted feature services and webmap secured via OAuth2. The webmap is consumed by the ArcGIS JavaScript application. The webmap consists of a basemap and about 250 layers, only 5 of which are visible at load.&lt;/P&gt;&lt;P&gt;I wonder if the legend widget is rendering symbology for all layers at load - and this is what is affecting performance. Nonetheless, our customers are noticing it.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 21:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1302736#M81515</guid>
      <dc:creator>Dirk_Vandervoort</dc:creator>
      <dc:date>2023-06-24T21:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Legend widget 4x: poor performance with many layers but only a few visible</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1303070#M81532</link>
      <description>&lt;P&gt;This sounds about right as the Legend widget will need to make a request to each layer on the WebMap, particularly since 250 layers is a lot of requests to be made.&lt;/P&gt;&lt;P&gt;As a general rule of thumb I would recommend no more than 10 layers in any one WebMap as more than this can cause performance issues as requests will be made to every layer, regardless if these are visible or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1303070#M81532</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2023-06-26T16:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Legend widget 4x: poor performance with many layers but only a few visible</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1303378#M81540</link>
      <description>&lt;P&gt;I'm not sure if this would work, as I haven't tried it, but: what if, when you first load the webmap item and before you render anything on screen, you scan all the layers in the web map, and for any layers that are not visible make them hidden from the legend by setting the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled" target="_self"&gt;legendEnabled&lt;/A&gt;&amp;nbsp;to false (or you could also author the web map to do this for layers that are not visible by default).&lt;BR /&gt;&lt;BR /&gt;For each layer that you do this to, you'd then have to watch (once) its visible property, and turn the legendEnabled option back on once the layer becomes visible.&lt;/P&gt;&lt;P&gt;Maybe someone else knows for sure whether this could help.&amp;nbsp; If it is the start-up performance specifically related to the legend widget that's the issue, maybe it's worth a try.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 14:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1303378#M81540</guid>
      <dc:creator>mleahy_cl</dc:creator>
      <dc:date>2023-06-27T14:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Legend widget 4x: poor performance with many layers but only a few visible</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1305345#M81613</link>
      <description>&lt;P&gt;Yeah, I've thought about various ways I might be able delay construction of the legend until after complete rendering of the webmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still haven't landed on anything solid yet.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 15:08:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-widget-4x-poor-performance-with-many-layers/m-p/1305345#M81613</guid>
      <dc:creator>Dirk_Vandervoort</dc:creator>
      <dc:date>2023-07-03T15:08:46Z</dc:date>
    </item>
  </channel>
</rss>

