<?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: Show only layers visible on map in the layerlist in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825858#M7840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Akshay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So that is your issue then. You do not set the layers visibility directly. You need to use the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layerstructure.htm" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;jimu/LayerStructure&lt;/A&gt;&amp;nbsp;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layernode.htm" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;jimu/LayerNode&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would use code like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;define&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="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'jimu/LayerStructure'&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="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="keyword token"&gt;function&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="punctuation token"&gt;.&lt;/SPAN&gt;
LayerStructure&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="comment token"&gt;//get the layer structure&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerStructure&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LayerStructure&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="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// this loops through all the layers and turns then off&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&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;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;layerNode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;currentTarget&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toggle&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;
&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="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;/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;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 09:55:53 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-12T09:55:53Z</dc:date>
    <item>
      <title>Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825854#M7836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have developed an application where we turn on the layer visibility programmatically. These layers are on a web map. Now in the layer list widget, I don't want to show all the layers, I just want to show which I have turned on programmatically.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is when I configure layerlist, by default I don't add any layers in there. But now when I make the portal layer visibility true, it does not come up in layerlist widget automatically.&amp;nbsp; How can I achieve&amp;nbsp;this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/message/447151"&gt;Roberts Custom WAB Widgets&lt;/A&gt;‌ any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 11:44:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825854#M7836</guid>
      <dc:creator>akshayloya</dc:creator>
      <dc:date>2018-05-18T11:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825855#M7837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I propose this:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/web-appbuilder/guide/communication-between-widgets.htm" title="https://developers.arcgis.com/web-appbuilder/guide/communication-between-widgets.htm"&gt;Communication between widgets—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>Fri, 18 May 2018 12:16:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825855#M7837</guid>
      <dc:creator>Adri2cPérez_Beneito</dc:creator>
      <dc:date>2018-05-18T12:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825856#M7838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Akshay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Now in the layer list widget, I don't want to show all the layers, I just want to show which I have turned on programmatically.&amp;nbsp;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This is an issue because the layerlist should show all layer visible or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There must be something wrong with how you are&amp;nbsp;setting the layers to be visible for then not to automatically show in the layer list widget as visible. I would have to see some code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 13:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825856#M7838</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-05-18T13:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825857#M7839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I'm doing. I really don't want all the layers in the layerlist as there are&amp;nbsp;200 of them. I just want the one which I programmatically&amp;nbsp;open.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; layers &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.map.getLayersVisibleAtScale(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.map.getScale());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; array.forEach(layers, lang.hitch(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (layer) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (layer.name &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; evt.currentTarget.title) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; (evt.currentTarget.checked &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;==&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; layer.setVisibility(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; } &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; layer.setVisibility(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;false&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; }));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;SO basically when the&amp;nbsp;&amp;nbsp;layer.setVisibility(&lt;SPAN style="color: #0000ff;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;); ....It should come in the layerlist widget also.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 13:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825857#M7839</guid>
      <dc:creator>akshayloya</dc:creator>
      <dc:date>2018-05-18T13:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825858#M7840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Akshay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;So that is your issue then. You do not set the layers visibility directly. You need to use the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layerstructure.htm" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;jimu/LayerStructure&lt;/A&gt;&amp;nbsp;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layernode.htm" style="color: #2989c5; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;jimu/LayerNode&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would use code like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;define&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="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'jimu/LayerStructure'&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="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="keyword token"&gt;function&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="punctuation token"&gt;.&lt;/SPAN&gt;
LayerStructure&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="comment token"&gt;//get the layer structure&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerStructure&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LayerStructure&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="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// this loops through all the layers and turns then off&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&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;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;layerNode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; evt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;currentTarget&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toggle&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;
&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="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;/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;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 09:55:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825858#M7840</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825859#M7841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe I failed to explain my issue correctly. Anyway solved it by simply changing the config value. I was just stressed out today. Thanks &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Called the below function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; showLayers: &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; () {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;debugger&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;// summary:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;// create a LayerListView module used to draw layers list in browser.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.layerListView &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; LayerListView({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; operLayerInfos: &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.operLayerInfos,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; layerListWidget: &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; config: &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.config&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; }).placeAt(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.layerListBody);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 14:36:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825859#M7841</guid>
      <dc:creator>akshayloya</dc:creator>
      <dc:date>2018-05-18T14:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825860#M7842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akshay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having the same issue as you mentioned. But whatever you mentioned in the above code that is already in LayerList\Widget.js.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain your solutions in details and from where you called this function. If possible code snippet will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using WAB 2.8 default Layer List widget.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;When I add any dynamic layer to the map through another custom widget as per below code.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;the map is showing properly with the visible&amp;nbsp;layers which are provided with a SetVisibleLayers option. But the same is not reflecting in LayerList widget and default it is considering map service Default Visibility property and showing all nodes as checked even though on the map that layers are not visible.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; border: 0px; font-weight: bold; font-size: 14.4px;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Code:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I added a sample water network map service&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver5.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FWater_Network%2FMapServer" rel="nofollow" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;Water_Network (MapServer)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;BR /&gt;var dynamicLayer = new ArcGISDynamicMapServiceLayer(url, {&lt;BR /&gt;'visible': true&lt;BR /&gt;});&lt;BR /&gt;dynamicLayer.setVisibleLayers([-1,-1,20,21,23]);&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;map.addLayer(&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;dynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Thanks&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Arun E&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/825860#M7842</guid>
      <dc:creator>arunepuri1</dc:creator>
      <dc:date>2018-12-04T18:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Show only layers visible on map in the layerlist</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/1270421#M14876</link>
      <description>&lt;P&gt;Solved one of my problems, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 14:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/show-only-layers-visible-on-map-in-the-layerlist/m-p/1270421#M14876</guid>
      <dc:creator>elogplaza</dc:creator>
      <dc:date>2023-03-22T14:51:08Z</dc:date>
    </item>
  </channel>
</rss>

