Can you please take a look at This Demo and let me know how I can get the Selected Layer Name through API when check boxes are checked?
As you can see at This Link the service is providing 3 layers as:
and I need to get these names as they are selected I already tried the Request layer info but this seems retuns metadata about fields only Thanks
Solved! Go to Solution.
LayerInfos has the information.
so
layer.layerInfos[0].name returns Cities
layer.layerInfos[1].name returns Rivers
layer.layerInfos[2].name returns States
layer is the ArcGISDynamicMapServiceLayer for that service in your example.
LayerInfos has the information.
so
layer.layerInfos[0].name returns Cities
layer.layerInfos[1].name returns Rivers
layer.layerInfos[2].name returns States
layer is the ArcGISDynamicMapServiceLayer for that service in your example.