<?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: hide certain sublayer on Layerlist widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428652#M39408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like you need to hide the specific sublayer. In that case, you need to get the sublayer instance and set its listMode to hide. Here's a sample app that does this. If you comment out the following code, you will see the sublayer appear in the LayerList. Leave it, and it is removed, but remains in the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/kekenes/pen/NMrMMr?&amp;amp;editors=100" title="https://codepen.io/kekenes/pen/NMrMMr?&amp;amp;editors=100" rel="nofollow noopener noreferrer" target="_blank"&gt;LayerList widget - 4.7&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; walkCurrentLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;flatten&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;item&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;return&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sublayers&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="token function"&gt;find&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;layer&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;return&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"walkability current"&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
walkCurrentLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"hide"&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>Sat, 11 Dec 2021 19:17:00 GMT</pubDate>
    <dc:creator>KristianEkenes</dc:creator>
    <dc:date>2021-12-11T19:17:00Z</dc:date>
    <item>
      <title>hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428650#M39406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Grouplayer and try to hide certain sublayer on Layerlist widget. If I use listMode(hide-children) then all the sublayes not show up all.&lt;/P&gt;&lt;P&gt;Can someone show me&amp;nbsp; how to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428650#M39406</guid>
      <dc:creator>weeyeo</dc:creator>
      <dc:date>2018-04-25T15:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428651#M39407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try setting the listMode("hide") on the particular layer you want to hide, not on the group layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428651#M39407</guid>
      <dc:creator>LizEidsness</dc:creator>
      <dc:date>2018-04-25T15:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428652#M39408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like you need to hide the specific sublayer. In that case, you need to get the sublayer instance and set its listMode to hide. Here's a sample app that does this. If you comment out the following code, you will see the sublayer appear in the LayerList. Leave it, and it is removed, but remains in the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/kekenes/pen/NMrMMr?&amp;amp;editors=100" title="https://codepen.io/kekenes/pen/NMrMMr?&amp;amp;editors=100" rel="nofollow noopener noreferrer" target="_blank"&gt;LayerList widget - 4.7&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; walkCurrentLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;flatten&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;item&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;return&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sublayers&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="token function"&gt;find&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;layer&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;return&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"walkability current"&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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
walkCurrentLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;listMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"hide"&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>Sat, 11 Dec 2021 19:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428652#M39408</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2021-12-11T19:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428653#M39409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the sample.&amp;nbsp; I try it and still can't get the sublayer to hide at all.&amp;nbsp; See the sample code below.&amp;nbsp; Can you see anything I am missing.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsfiddle.net/sky12/02c8wpf6/" title="https://jsfiddle.net/sky12/02c8wpf6/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 20:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428653#M39409</guid>
      <dc:creator>jamesa</dc:creator>
      <dc:date>2018-04-25T20:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428654#M39410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like listMode isn't part of the MapImageLayer sublayer API:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#properties-summary" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#properties-summary"&gt;Sublayer | API Reference | ArcGIS API for JavaScript 4.7&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll see what we can do to add support for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 21:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428654#M39410</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2018-04-25T21:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: hide certain sublayer on Layerlist widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428655#M39411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 21:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hide-certain-sublayer-on-layerlist-widget/m-p/428655#M39411</guid>
      <dc:creator>jamesa</dc:creator>
      <dc:date>2018-04-25T21:31:38Z</dc:date>
    </item>
  </channel>
</rss>

