<?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 first dynamic layer on top cannot turn off visibility in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-dynamic-layer-on-top-cannot-turn-off/m-p/29184#M2472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the basemapgallery, a legend, and a TOC.&amp;nbsp; Everything is working fine except for the very first dynamicmapservicelayer that I add using&amp;nbsp;&amp;nbsp; map.addLayer.(layername);&amp;nbsp;&amp;nbsp; is staying on TOP of all of the other layers and will not change visibility when I use the checkbox in the TOC.&amp;nbsp; I am not using any featurelayers.&amp;nbsp; I want to be able to turn on/off all dynamic layers.&amp;nbsp; Is this a bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 4 dynamic layers loading using syntax like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;var layernameLayer = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://...../Mapserver" rel="nofollow" target="_blank"&gt;http://...../Mapserver&lt;/A&gt;&lt;SPAN&gt;", {visible:true}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayer(layernameLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I removed the map.addLayer(layernameLayer); after each one and combined them into:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayers([layernameLayer, layernameLayer, etc.]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, none of the four layers can be set to on/off in TOC.&amp;nbsp;&amp;nbsp; baffling!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I take that back, still the first one listed is the only one on TOP that cannot be set to visibility:false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luci&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2012 16:22:55 GMT</pubDate>
    <dc:creator>LuciHawkins</dc:creator>
    <dc:date>2012-05-08T16:22:55Z</dc:date>
    <item>
      <title>first dynamic layer on top cannot turn off visibility</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-dynamic-layer-on-top-cannot-turn-off/m-p/29184#M2472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the basemapgallery, a legend, and a TOC.&amp;nbsp; Everything is working fine except for the very first dynamicmapservicelayer that I add using&amp;nbsp;&amp;nbsp; map.addLayer.(layername);&amp;nbsp;&amp;nbsp; is staying on TOP of all of the other layers and will not change visibility when I use the checkbox in the TOC.&amp;nbsp; I am not using any featurelayers.&amp;nbsp; I want to be able to turn on/off all dynamic layers.&amp;nbsp; Is this a bug?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 4 dynamic layers loading using syntax like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;var layernameLayer = new esri.layers.ArcGISDynamicMapServiceLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://...../Mapserver" rel="nofollow" target="_blank"&gt;http://...../Mapserver&lt;/A&gt;&lt;SPAN&gt;", {visible:true}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayer(layernameLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I removed the map.addLayer(layernameLayer); after each one and combined them into:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayers([layernameLayer, layernameLayer, etc.]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, none of the four layers can be set to on/off in TOC.&amp;nbsp;&amp;nbsp; baffling!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I take that back, still the first one listed is the only one on TOP that cannot be set to visibility:false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luci&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 16:22:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/first-dynamic-layer-on-top-cannot-turn-off/m-p/29184#M2472</guid>
      <dc:creator>LuciHawkins</dc:creator>
      <dc:date>2012-05-08T16:22:55Z</dc:date>
    </item>
  </channel>
</rss>

