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?
Ulises,
Change the sublayers array to descending order (i.e. 8 then 2) and it will work.
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.
Thanks, it works.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.