AnsweredAssumed Answered

Why aren't all layers displayed when using MapImageLayer without specifying sublayer?  It seemed to work in version 4.4..

Question asked by Jefairfi on Jul 12, 2018
Latest reply on Jul 13, 2018 by Jefairfi

In my simple JSBin example, why aren't all layers from my arcgis rest endpoint being shown?

Simple JS bin example 

 

According to the documentation, when adding a MapImageLayer to the map:

A Collection of Sublayer 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.

 

In my example, I am not specifying the sublayers property.  So why aren't all of my layers being included?

 

I noticed that if you change the ESRI JS API version back to 4.4, it works as expected:

 

 

I also inspected the network requests and compared the 4.4 api version to the 4.8 version:

 

4.4 Request

4.8 Request

 

For some reason, the "Layers" parameter doesn't seem to be correctly populated in the 4.5-4.8 version of the JS api.

 

This breaking change in the api wasn't listed in the release notes for js version 4.5.

Release notes for 4.5 

 

Thanks for any help debugging / finding a workaround for this issue.

Outcomes