I have a ArcGISDynamicMapServiceLayer containing many layers. I'd need to add only individual layers to the map, like layers 2,5 and 10.
The following code would add all the layers to the map:
url = "http://...MapServer";
mapServiceLayer = new ArcGISDynamicMapServiceLayer(url, {
className: layer,
opacity: opacity
});
map.addLayer(mapServiceLayer);
How can I add only i.e. layer 5 to the map? (.../MapServer/5)
There is a similar question here but answers seem not to be helpful for the front end solution.