add more than two sub-layers with MapImageLayer version 4.12?

1223
3
Jump to solution
10-18-2019 06:36 AM
UlisesTabares
New Contributor II

Layers = new MapImageLayer({
url:"http://0.0.0.0:6080/arcgis/rest/services/VISOR/MapServer",
sublayers:[
{
id: 2,
visible:true
},
{
id: 8,
visible: true
}

this works fine but when add 1 more id layer stop working, I'm based on this example MapImageLayer - Toggle sublayer visibility | ArcGIS API for JavaScript 4.13 , but I don't think it works very well either.

Can you help me?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Ulises,

  Change the sublayers array to descending order (i.e. 8 then 2) and it will work.

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Ulises,

  Change the sublayers array to descending order (i.e. 8 then 2) and it will work.

UlisesTabares
New Contributor II

Thanks, it works.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos