<?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: ArcGIS Online web map item - setVisibleLayers() and then query returns wrong data in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-online-web-map-item-setvisiblelayers-and/m-p/651852#M60788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made this fiddle, that shows the problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://jsfiddle.net/UFLfT/34/"&gt;http://jsfiddle.net/UFLfT/34/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2013 06:38:43 GMT</pubDate>
    <dc:creator>HerdisGudbrandsdottir</dc:creator>
    <dc:date>2013-05-28T06:38:43Z</dc:date>
    <item>
      <title>ArcGIS Online web map item - setVisibleLayers() and then query returns wrong data</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-online-web-map-item-setvisiblelayers-and/m-p/651851#M60787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My problem is that my map created using&amp;nbsp; esri.arcgis.utils.createMap(webmapItem), only queries layers initially turned on in ArcGIS Online Web Map. I hope someone here can help me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my web map application I want to toggle layers in a web map layer on/off using setVisibleLayers(). When updating the visibleLayers, the layers are correctly toggled on/off, but if I click my map, the map only queries the layers that are turned on in web map saved on ArcGIS Online, regardless of the updated visibleLayers property on my map layer in the application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The clickHandler is returned initially in the response object returned by createMap(). Is there a way to update this with the current visible layers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map = esri.arcgis.utils.createMap(webmapid, mapDiv);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
var layer = map.getLayer(map.layerIds[1])
layer.setVisibleLayers([1,2]);
//layer visibilities are updated correctly in map - but the change is not reflected in clickHandle
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Usage: I want to toggle layer visibility in a TOC and have the queries working on the visible layers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 13:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-online-web-map-item-setvisiblelayers-and/m-p/651851#M60787</guid>
      <dc:creator>HerdisGudbrandsdottir</dc:creator>
      <dc:date>2013-04-15T13:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Online web map item - setVisibleLayers() and then query returns wrong data</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-online-web-map-item-setvisiblelayers-and/m-p/651852#M60788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I made this fiddle, that shows the problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://jsfiddle.net/UFLfT/34/"&gt;http://jsfiddle.net/UFLfT/34/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 06:38:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-online-web-map-item-setvisiblelayers-and/m-p/651852#M60788</guid>
      <dc:creator>HerdisGudbrandsdottir</dc:creator>
      <dc:date>2013-05-28T06:38:43Z</dc:date>
    </item>
  </channel>
</rss>

