<?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 jimu layerStructure and layer.hide()/layer.show() - Calls to ArcGIS Server in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jimu-layerstructure-and-layer-hide-layer-show/m-p/773131#M1813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in the world of custom WAB development using JSAPI 3.x, and looking at some performance tweaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that when I use the&amp;nbsp;following approach to update multiple layers' visibility, it takes a long time to update the map...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layerStructure&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;traversal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerNode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//...&lt;/SPAN&gt;
   layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//or&lt;/SPAN&gt;
   layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;show&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//...&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I see in Chrome Dev Tools is that for each pass through and layer for which visibility is updated, there is a call to server that returns a new PNG. I guess that makes sense. So&amp;nbsp;we're waiting for the last of multiple images to be available before the update&amp;nbsp;of the map is reflected&amp;nbsp;in the browser. Is there a way to&amp;nbsp;somehow&amp;nbsp;redesign this to where I can make all my update before the&amp;nbsp;call to the server happens and then receive one PNG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On on only remotely related note, it says here&amp;nbsp;(&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jshelp/best_practices_feature_layers.html" title="https://developers.arcgis.com/javascript/3/jshelp/best_practices_feature_layers.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Feature Layer Best Practices | Guide | ArcGIS API for JavaScript 3.33&lt;/A&gt;) that for JSAPI 2.6 and later feature generalization (using&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;maxAllowableOffset) is the default. Does that also apply for any layers&amp;nbsp;in Web AppBuilder? If I have a a webmap that includes&amp;nbsp;a layer with rather complex polygons, is it by default using generalization when zooming in/out, and if not, how can I leverage&amp;nbsp;&lt;SPAN&gt;maxAllowableOffset?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:39:12 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2021-12-12T08:39:12Z</dc:date>
    <item>
      <title>jimu layerStructure and layer.hide()/layer.show() - Calls to ArcGIS Server</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jimu-layerstructure-and-layer-hide-layer-show/m-p/773131#M1813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in the world of custom WAB development using JSAPI 3.x, and looking at some performance tweaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that when I use the&amp;nbsp;following approach to update multiple layers' visibility, it takes a long time to update the map...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layerStructure&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;traversal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerNode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//...&lt;/SPAN&gt;
   layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hide&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//or&lt;/SPAN&gt;
   layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;show&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//...&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What I see in Chrome Dev Tools is that for each pass through and layer for which visibility is updated, there is a call to server that returns a new PNG. I guess that makes sense. So&amp;nbsp;we're waiting for the last of multiple images to be available before the update&amp;nbsp;of the map is reflected&amp;nbsp;in the browser. Is there a way to&amp;nbsp;somehow&amp;nbsp;redesign this to where I can make all my update before the&amp;nbsp;call to the server happens and then receive one PNG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On on only remotely related note, it says here&amp;nbsp;(&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jshelp/best_practices_feature_layers.html" title="https://developers.arcgis.com/javascript/3/jshelp/best_practices_feature_layers.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Feature Layer Best Practices | Guide | ArcGIS API for JavaScript 3.33&lt;/A&gt;) that for JSAPI 2.6 and later feature generalization (using&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;maxAllowableOffset) is the default. Does that also apply for any layers&amp;nbsp;in Web AppBuilder? If I have a a webmap that includes&amp;nbsp;a layer with rather complex polygons, is it by default using generalization when zooming in/out, and if not, how can I leverage&amp;nbsp;&lt;SPAN&gt;maxAllowableOffset?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #fefefe;"&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:39:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/jimu-layerstructure-and-layer-hide-layer-show/m-p/773131#M1813</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T08:39:12Z</dc:date>
    </item>
  </channel>
</rss>

