ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer = (ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer)(Map1.Layers[0]); // Get the count of the number of sub-layers in the ArcGISDynamicMapServiceLayer. int numLayers = myArcGISDynamicMapServiceLayer.Layers.Length; List<int> visibleLayers = new List<int>(); // Loop through each sub-layer. for (var i = 0; i < numLayers; i++) { // Get the sub-layer visibility. bool myLayerVisibility = myArcGISDynamicMapServiceLayer.GetLayerVisibility(i); if (myLayerVisibility) { visibleLayers.Add(i); } }
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.