Something really strange is happening and I do not know why. When I create a new MapImageLayer and call for two sublayers whereas the visible value for both sublayers is 'true' I get an error.
RAILLAYER = new MapImageLayer({
url: "https://rave1:6443/arcgis/rest/services/RAIL/MapServer", sublayers: [
{id: 0,
visible: true,
title: "Railway Station"},
{id: 20,
visible: true,
title: "Railway"}
]
});
When there is one visible value as true (the other false), the sublayer displays.
RAILLAYER = new MapImageLayer({
url: "https://rave1:6443/arcgis/rest/services/RAIL/MapServer", sublayers: [{id: 0,
visible: true,
title: "Railway Station"},
{id: 20,
visible: false,
title: "Railway"}
]
});
The weird thing is that I tried using the sample layer from esri
http://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/MapServer
and it works perfectly when both sublayers visible value are defined as true.
So I just want to figure out what could be the cause of this issue. By the way I am using arcgis javascript 4.10