<?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: ArcGISDynamicMapServiceLayer: unwanted layers included in render in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113853#M10600</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I &lt;STRONG&gt;don't&lt;/STRONG&gt; think that it will break the LayerList widget. You should try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 18:04:14 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-03-06T18:04:14Z</dc:date>
    <item>
      <title>ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113846#M10593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I have an issue where the image render returned by the MapServer does not seem to correspond to the list of visibleLayers specified in the ArcGISDynamicMapServiceLayer. It seems all child layers of a group layer are rendered, whether they are included in the list of visibleLayers or not.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS API for JavaScript 3.19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS Server 10.3.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is an example of a group layer 256 with child layers 257 to 270&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="335076" alt="Screenshot-1" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335076_Screenshot-3.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using a layers widget binded to the list of visibleLayers of the ArcGISDynamicMapServiceLayer, if I check one of the child layer, this is export request sent by the API:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="335077" alt="Screenshot-2" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335077_Screenshot-16.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG __jive_id="335087" alt="Screenshot-3" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/335087_Screenshot-17.png" style="width: 818px; height: 149px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can see that only 256 and 270 are included in the layers parameter of the export request, yet the MapServer will render ALL sublayers 257 to 270.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is this the default behaviour of the MapServer??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If so, how do I work around this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm thinking maybe I could manually remove group layers in the list of visibleLayers of the&amp;nbsp;&lt;SPAN&gt;ArcGISDynamicMapServiceLayer, but that could create issues with the layers widget, where the group layer would be unchecked too (since it's binded to it), which is not what we want.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I see the export request (&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/rest/apiref/export.html" title="http://resources.arcgis.com/en/help/rest/apiref/export.html"&gt;Export Map (Operation)&lt;/A&gt;&amp;nbsp;) layers parameter also include an "exclude" option. Is there a way I could exclude all unchecked layers using a setting or option in the ArcGIS JavaScript API? Otherwise how would I do this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is a more obvious example with an infrastructure group layer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="" class="image-4 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335122_Screenshot-20.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="" class="image-5 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335126_Screenshot-21.png" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Only child layer 168 is included in the list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="" class="image-6 jive-image" src="https://community.esri.com/legacyfs/online/335127_Screenshot-22.png" style="width: 810px; height: 149px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But it renders them all:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;IMG alt="" class="image-7 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335129_Screenshot-24.png" style="width: 620px; height: 548px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 14:41:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113846#M10593</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2017-03-06T14:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113847#M10594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure, the layers 257 to 270 are all displayed. As you have shared the request sent but not the response received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen something similar happen, when I use LayerDrawingOptions. If you are updating a layer drawing option for a particular layer and do not update all the layer properties, i.e just change labelingInfo or transparency of only one or few layers. Then it will get the default properties for other layers, which may be visible = true. But this happens on a very specific condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you using LayerDrawingOptions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 15:01:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113847#M10594</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2017-03-06T15:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113848#M10595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pretty sure yes. Well the response is just an image but I can see the top child layer 257 is rendered, since it's on top of the other child layers. What I want rendered is only the old 1950 ortho layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot-4" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335089_Screenshot-18.png" style="width: 620px; height: 358px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but instead it renders the newest one, here is the response in Chrome:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot-5" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/335120_Screenshot-19.png" style="width: 620px; height: 351px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also this was just an example, I have seen similar results with all the other layers in the service. For instance we have an infrastructure group including stuff like man holes, fire hydrants, etc.. if I check a single child layer in the group, ArcGIS Server will render all the child layers (all the infrastructure layers) in the image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not using LayerDrawingOptions anywhere in my code, no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you saying that this is not normal? Should the normal behavior of ArcGIS Server be to render ONLY the layers included in the layers parameter of the export request? I can't find any doc that says so specifically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 15:18:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113848#M10595</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2017-03-06T15:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113849#M10596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If a group layer id is included in the map export layers array then all the layers are exported. All group layers have to be removed when you create your visible layers list. If you remove id 256 from your visibleLayers then you should be fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 16:08:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113849#M10596</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-06T16:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113850#M10597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this documented some where?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 16:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113850#M10597</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2017-03-06T16:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113851#M10598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not that I know of it is just a &lt;STRONG&gt;feature&lt;/STRONG&gt; that I have been familiar with since my Flex days.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 16:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113851#M10598</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-06T16:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113852#M10599</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;Thanks for the confirmation.&amp;nbsp;I realise I could just remove the group layer ids for the visibleLayers but that will break the layers widget, which is binded to the list of visibleLayers. If there is no other way I'll try and figure something out but it will really complexify my code. I really wish this was optional through the API, I mean the exclude parameter of the export request is right there, it's available, why not use it..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113852#M10599</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2017-03-06T17:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113853#M10600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I &lt;STRONG&gt;don't&lt;/STRONG&gt; think that it will break the LayerList widget. You should try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 18:04:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113853#M10600</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-06T18:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113854#M10601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did and as predicted the group layers I removed became unchecked in the layers widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's alright though, I ended up just unbinding the widget from the&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;ArcGISDynamicMapServiceLayer and give it the list of visibleLayers myself, manually. Not as bad as I thought.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;As for the&amp;nbsp;&lt;SPAN&gt;ArcGISDynamicMapServiceLayer, whenever I need to set the visibleLayers I call this function to remove the group layers. For anyone interested:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;initGroupLayers&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;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;groupLayers &lt;SPAN class="operator 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; array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;forEach&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dynamicMapServiceLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerInfos&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&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;layerInfo&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; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;subLayerIds&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;groupLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;push&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&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; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;

_setVisibleLayers&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;params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// Filter out any group layer from the list of visibleLayers&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; filteredLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; array&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;visibleLayers&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;groupLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;indexOf&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="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; &lt;SPAN class="comment token"&gt;// Update using the filtered list&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dynamicMapServiceLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setVisibleLayers&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filteredLayers&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;/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;The initGroupLayers function is called once in the "load" event handler of the dynamicMapServiceLayer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113854#M10601</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2021-12-11T06:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113855#M10602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a problem with a group layer in the results from an IdentifyTask. I was able to filter these out when setting up the &lt;SPAN&gt;IdentifyParameters&lt;/SPAN&gt; using this code (from this &lt;A _jive_internal="true" href="https://community.esri.com/message/361031?commentID=361031#comment-361031" target="_blank"&gt;discussion&lt;/A&gt;)&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; visLayers &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;visibleLayers&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;visLayers &lt;SPAN class="operator token"&gt;!==&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&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; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; subLayers &lt;SPAN class="operator 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; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerInfos&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; i&lt;SPAN class="operator 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;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerInfos&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;subLayerIds &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subLayers&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;push&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerInfos&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&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; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; idParams&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerIds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; subLayers&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp; 
&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;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; idParams&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layerIds &lt;SPAN class="operator 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; 
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&amp;nbsp; ‍‍‍‍‍‍‍‍‍‍‍&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;/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 06:46:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113855#M10602</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T06:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113856#M10603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ken,&amp;nbsp;yeah I'll definitely make a few adjustments. Would be cleaner to just build a list of group layers once, and then &amp;nbsp;use that list as a parameter to array.filter the list of visibleLayers to display. Now that I was able to hotfix this issue quickly, I'll be able to polish it a little.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind of an unrelated question but how the heck did you format your code in geonet? The code tool does nothing for me, seems broken. Maybe it just doesn't work with Chrome I'm not sure. What browser are you using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 14:31:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113856#M10603</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2017-03-07T14:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113857#M10604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually use Firefox, but for this reply, I'll use Chrome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;This is the code I'll insert&lt;SPAN class="line-numbers-rows"&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;To do this, I click on the "Expand toolbar" button&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/336658_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Then I click the "Syntax highlighter" under "More"&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/336749_pastedImage_2.png" style="width: 620px; height: 263px;" /&gt;&lt;/P&gt;&lt;P&gt;Note that this isn't available when you reply to a message from the Inbox.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 18:35:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113857#M10604</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-03-08T18:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGISDynamicMapServiceLayer: unwanted layers included in render</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113858#M10605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome thanks, I can finally use this properly format code.&lt;/P&gt;&lt;P&gt;I just edited my answer with this formatting, and replaced the original code with the better code version I was talking about too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 18:47:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgisdynamicmapservicelayer-unwanted-layers/m-p/113858#M10605</guid>
      <dc:creator>YohanBienvenue</dc:creator>
      <dc:date>2017-03-08T18:47:06Z</dc:date>
    </item>
  </channel>
</rss>

