<?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 Why aren't all layers displayed when using MapImageLayer without specifying sublayer?  It seemed to work in version 4.4.. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717473#M66642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my simple JSBin example, why aren't all layers from my arcgis rest endpoint being shown?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsbin.com/kuzuxitaqu/edit?html,js,output" title="https://jsbin.com/ziyejuquqa/edit?html,output"&gt;Simple JS bin example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers"&gt;documentation&lt;/A&gt;, when adding a MapImageLayer to the map:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;A&lt;SPAN&gt;&amp;nbsp;Collection&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of&lt;SPAN&gt;&amp;nbsp;Sublayer&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example, I am not specifying the sublayers property.&amp;nbsp; So why aren't all of my layers being included?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that if you change the ESRI JS API version back to 4.4, it works as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414041" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/414041_pastedImage_6.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also inspected the network requests and compared the 4.4 api version to the 4.8 version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4.4 Request&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414042" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/414042_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4.8 Request&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414043" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/414043_pastedImage_10.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason, the "Layers" parameter doesn't seem to be correctly populated in the 4.5-4.8 version of the JS api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This breaking change in the api wasn't listed in the release notes for js version 4.5.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/guide/release-notes/4.5/index.html#breaking-changes" title="https://developers.arcgis.com/javascript/latest/guide/release-notes/4.5/index.html#breaking-changes"&gt;Release notes for 4.5&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help debugging / finding a workaround for this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jul 2018 16:56:04 GMT</pubDate>
    <dc:creator>JackFairfield</dc:creator>
    <dc:date>2018-07-12T16:56:04Z</dc:date>
    <item>
      <title>Why aren't all layers displayed when using MapImageLayer without specifying sublayer?  It seemed to work in version 4.4..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717473#M66642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my simple JSBin example, why aren't all layers from my arcgis rest endpoint being shown?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsbin.com/kuzuxitaqu/edit?html,js,output" title="https://jsbin.com/ziyejuquqa/edit?html,output"&gt;Simple JS bin example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers"&gt;documentation&lt;/A&gt;, when adding a MapImageLayer to the map:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;A&lt;SPAN&gt;&amp;nbsp;Collection&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of&lt;SPAN&gt;&amp;nbsp;Sublayer&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example, I am not specifying the sublayers property.&amp;nbsp; So why aren't all of my layers being included?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that if you change the ESRI JS API version back to 4.4, it works as expected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414041" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/414041_pastedImage_6.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also inspected the network requests and compared the 4.4 api version to the 4.8 version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4.4 Request&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414042" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/414042_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4.8 Request&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="414043" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/414043_pastedImage_10.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason, the "Layers" parameter doesn't seem to be correctly populated in the 4.5-4.8 version of the JS api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This breaking change in the api wasn't listed in the release notes for js version 4.5.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/guide/release-notes/4.5/index.html#breaking-changes" title="https://developers.arcgis.com/javascript/latest/guide/release-notes/4.5/index.html#breaking-changes"&gt;Release notes for 4.5&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help debugging / finding a workaround for this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717473#M66642</guid>
      <dc:creator>JackFairfield</dc:creator>
      <dc:date>2018-07-12T16:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't all layers displayed when using MapImageLayer without specifying sublayer?  It seemed to work in version 4.4..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717474#M66643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like maybe 4.4 was handling it incorrectly.&lt;/P&gt;&lt;P&gt;Looking at the service info, the defaultVisibility of all layers except for "Bikeways" is false, so 4.8 is displaying the layer correctly now.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://geo.azmag.gov/gismag/rest/services/Test/BikeMap_Test/MapServer?f=pjson" title="https://geo.azmag.gov/gismag/rest/services/Test/BikeMap_Test/MapServer?f=pjson"&gt;https://geo.azmag.gov/gismag/rest/services/Test/BikeMap_Test/MapServer?f=pjson&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could iterate over the sublayers and turn them all on if you'd like&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsbin.com/hawovor/1/edit?js,output" title="https://jsbin.com/hawovor/1/edit?js,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use the LayerList to manage the visibility. You can see that the LayerList also picked up the correct visibility of the layers.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsbin.com/hawovor/3/edit?js,output" title="https://jsbin.com/hawovor/3/edit?js,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2018 22:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717474#M66643</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2018-07-13T22:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why aren't all layers displayed when using MapImageLayer without specifying sublayer?  It seemed to work in version 4.4..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717475#M66644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help Rene.&amp;nbsp; I really appreciate it.&lt;/P&gt;&lt;P&gt;That makes total sense to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2018 23:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/why-aren-t-all-layers-displayed-when-using/m-p/717475#M66644</guid>
      <dc:creator>JackFairfield</dc:creator>
      <dc:date>2018-07-13T23:54:12Z</dc:date>
    </item>
  </channel>
</rss>

