<?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: Scale dependent layers visibility in LayerList in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/1590527#M86605</link>
    <description>&lt;P&gt;I want to achieve this functionality&amp;nbsp;&lt;SPAN&gt;By default, if a layer is not visible in the map due to scale dependencies, it is grayed out in the LayerList&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 05:09:17 GMT</pubDate>
    <dc:creator>BabyChauhan</dc:creator>
    <dc:date>2025-02-28T05:09:17Z</dc:date>
    <item>
      <title>Scale dependent layers visibility in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426210#M39191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two layers in my file that are scale dependent. How can I force the layerlist widget to only show that layer when the user is zoomed in to the point that the layer is visible and able to be turned on and off? I'm sure I'm missing something simple...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the Javascript 4.12 API.&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;Ashley&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2019 18:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426210#M39191</guid>
      <dc:creator>AshleyPeters</dc:creator>
      <dc:date>2019-07-15T18:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scale dependent layers visibility in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426211#M39192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/10963" target="_blank"&gt;Ashley Peters&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 j-img-floatend jive-image j-img-original" src="https://community.esri.com/legacyfs/online/453123_hide_layers.png" style="float: right;" /&gt;By default, if a layer is not visible in the map due to scale dependencies, it is grayed out in the LayerList. This is neat functionality, but apparently not what you want...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trick to accomplish what you want is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;'watch' the scale of you map with a&amp;nbsp;&lt;EM&gt;watch handler&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;set the &lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode" rel="nofollow noopener noreferrer" target="_blank"&gt;listMode&lt;/A&gt; of your layer(s) to &lt;EM&gt;hide &lt;/EM&gt;or &lt;EM&gt;show&lt;/EM&gt; accordingly.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this code snippet:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// watch handler: the callback fires each time the scale of the view changes&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; handle &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;watch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'scale'&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;newScale&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Scale: "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; newScale&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newScale &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;500000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        dutchMunicipalitiesLayer&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="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        dutchMunicipalitiesLayer&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;'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="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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have published the fully working example here: &lt;A class="link-titled" href="https://twiav.nl/tutorial/arcgis/javascript/arcgis_javascript_tutorial_scale_dependent_layerlist.htm" title="https://twiav.nl/tutorial/arcgis/javascript/arcgis_javascript_tutorial_scale_dependent_layerlist.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS JavaScript Tutorial - Scale dependent layers visibility in LayerList&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Egge-Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:11:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426211#M39192</guid>
      <dc:creator>Egge-Jan_Pollé</dc:creator>
      <dc:date>2021-12-11T19:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Scale dependent layers visibility in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426212#M39193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Egge-Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That worked beautifully! Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ashley&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2019 12:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/426212#M39193</guid>
      <dc:creator>AshleyPeters</dc:creator>
      <dc:date>2019-07-16T12:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scale dependent layers visibility in LayerList</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/1590527#M86605</link>
      <description>&lt;P&gt;I want to achieve this functionality&amp;nbsp;&lt;SPAN&gt;By default, if a layer is not visible in the map due to scale dependencies, it is grayed out in the LayerList&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 05:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/scale-dependent-layers-visibility-in-layerlist/m-p/1590527#M86605</guid>
      <dc:creator>BabyChauhan</dc:creator>
      <dc:date>2025-02-28T05:09:17Z</dc:date>
    </item>
  </channel>
</rss>

