<?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: How to remove all layers from a Web AppBuilder App (Dev) in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774115#M1908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Robert!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 00:29:40 GMT</pubDate>
    <dc:creator>ChristopherSchreiber</dc:creator>
    <dc:date>2016-09-16T00:29:40Z</dc:date>
    <item>
      <title>How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774111#M1904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been working on &amp;nbsp;a custom widget to work with our application. One of the requirements of this widget is to turn off all of the layers on the map while it is open and then turn them back on once it is closed. I have tried a few different methods of doing this with no luck as of yet. Has anyone came across something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 23:18:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774111#M1904</guid>
      <dc:creator>ChristopherSchreiber</dc:creator>
      <dc:date>2016-09-14T23:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774112#M1905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;This snippet of code will turn off all the parent layers:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token function"&gt;require&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"jimu/LayerInfos/LayerInfos"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&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;LayerInfos&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerInfos&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getInstance&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;itemInfo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&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;layerInfosObject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfosObject&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getLayerInfoArray&lt;/SPAN&gt;&lt;SPAN class="punctuation 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="token function"&gt;forEach&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;layerInfo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setTopLayerVisible&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation 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="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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:40:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774112#M1905</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T08:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774113#M1906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That solved my problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to re-activate the layers that were visible before the widget was activated?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 14:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774113#M1906</guid>
      <dc:creator>ChristopherSchreiber</dc:creator>
      <dc:date>2016-09-15T14:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774114#M1907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Sure you would have to maintain an array of layer visibility and then restore the layer visibility later using this array and&amp;nbsp;setTopLayerVisible as true.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 15:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774114#M1907</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-15T15:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774115#M1908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Robert!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 00:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774115#M1908</guid>
      <dc:creator>ChristopherSchreiber</dc:creator>
      <dc:date>2016-09-16T00:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774116#M1909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to modify this code snippet so it does not apply to parents, but rather to all child layers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 04:44:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774116#M1909</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-19T04:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774117#M1910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Simon,&lt;/P&gt;&lt;P class=""&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp; Not sure I understand. If you set the parent to be false all the children of that parent are no longer visible. If you set the child then just that hold is not visible. So you just get the id of the exact layer you want and use that. If you want to turn off multiple children then just use that line of code multiple times with their unique ids.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 13:35:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774117#M1910</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-19T13:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774118#M1911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The map I'm working with has a large number of child layers. In my mind, I run a for loop like the above to ensure that all child layers are not visible, then just switch the few on for the function required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This said, I'm starting to dig around with some of the functions and get the feeling that it wont be as simple as an easy modification to the code above. Perhaps loading subLayerIds to an array then looping through them? Thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 21:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774118#M1911</guid>
      <dc:creator>SimonWebster</dc:creator>
      <dc:date>2018-02-19T21:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove all layers from a Web AppBuilder App (Dev)</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774119#M1912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You need to look at traversal method of LayerInfos:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/web-appbuilder/api-reference/layerinfos.htm#ESRI_SECTION1_77C5BE1169F3422BB20E6276528DB8A8" title="https://developers.arcgis.com/web-appbuilder/api-reference/layerinfos.htm#ESRI_SECTION1_77C5BE1169F3422BB20E6276528DB8A8"&gt;LayerInfos class—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 21:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/how-to-remove-all-layers-from-a-web-appbuilder-app/m-p/774119#M1912</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-02-19T21:57:19Z</dc:date>
    </item>
  </channel>
</rss>

