<?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: WMSLayer - turn off all layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497741#M46277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sending empty array into setVisibleLayers for both &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer and WMSLayer would make sense, but unfortunatelly it doesn't work. To turn off all layer you have to send empty array for WMSLayer (as you said) and array with -1 -&amp;gt; [-1] for &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer. If I send empty array to &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer if show default visible layer as it's set in service &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 08:24:04 GMT</pubDate>
    <dc:creator>MichalSchneider</dc:creator>
    <dc:date>2014-09-25T08:24:04Z</dc:date>
    <item>
      <title>WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497735#M46271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can I turn off all layer at WMS service (WMSLayer)? When I'am using ArcGIS dynamic service (ArcGISDynamicMapServiceLayer) method &lt;SPAN class="pln" style="color: #000000;"&gt;setVisibleLayers([-1]) turns off all layers. I seems to me, that this approach doesn't help at WMS service...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 11:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497735#M46271</guid>
      <dc:creator>MichalSchneider</dc:creator>
      <dc:date>2014-09-24T11:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497736#M46272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wmsLayer.setVisibleLayers(["-1"]) does the trick.&lt;/P&gt;&lt;P&gt;Test with this &lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=layers_wmsresourceinfo" title="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=layers_wmsresourceinfo"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt;&amp;nbsp; sample&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 12:42:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497736#M46272</guid>
      <dc:creator>RiyasDeen</dc:creator>
      <dc:date>2014-09-24T12:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497737#M46273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Riyas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for such a quick answer, but it doesn't work &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/angry.png" /&gt; I've just tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 13:40:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497737#M46273</guid>
      <dc:creator>MichalSchneider</dc:creator>
      <dc:date>2014-09-24T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497738#M46274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; All you do is send an empty array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14115670272094320" jivemacro_uid="_14115670272094320"&gt;
&lt;P&gt;wmsLayer.setVisibleLayers([]);&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 13:57:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497738#M46274</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-24T13:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497739#M46275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you, it works! I just don't know why is there the difference in &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Anyway, thanks again.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 14:06:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497739#M46275</guid>
      <dc:creator>MichalSchneider</dc:creator>
      <dc:date>2014-09-24T14:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497740#M46276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I would think that the same would be true for the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer&lt;/SPAN&gt;. What you are doing is sending an array of layer IDs that you want visible and because that is not a layer id with -1 the &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer do not set any to visible. But the WMSLayer probably sees the -1 and it does not have that layer id and internally throws and error when searching for -1 and then bails because of the error. So sending an empty array would be the more accurate approach for both layer types.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 14:13:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497740#M46276</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-24T14:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497741#M46277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sending empty array into setVisibleLayers for both &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer and WMSLayer would make sense, but unfortunatelly it doesn't work. To turn off all layer you have to send empty array for WMSLayer (as you said) and array with -1 -&amp;gt; [-1] for &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer. If I send empty array to &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;ArcGISDynamicMapServiceLayer if show default visible layer as it's set in service &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 08:24:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497741#M46277</guid>
      <dc:creator>MichalSchneider</dc:creator>
      <dc:date>2014-09-25T08:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: WMSLayer - turn off all layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497742#M46278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks for the correction. I don't recall it being that way in other APIs like Flex where all my background comes from.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:07:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/wmslayer-turn-off-all-layer/m-p/497742#M46278</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-25T13:07:20Z</dc:date>
    </item>
  </channel>
</rss>

