Select to view content in your preferred language

Check whether a sub-layer in an ArcGISDynamicMapServiceLayer is a FeatureLayer?

587
1
04-20-2011 12:46 PM
SuiHuang
Frequent Contributor
Hi Everybody:

    I am developing a silverlight application that displays an ArcGISDynamicMapServiceLayer in a Map.
    Among all the sub-layers, I want to identify all the Feature Layers and do some corresponding process. However, I haven't found a good way to distinguish Feature Layers from all the others (such as Group Layers, Annotation Layers, and Annotation Sublayers).

    The following code can exclude all the Group Layers, but not Annotation Layers:
***********************************************
foreach (LayerInfo subLayer in tempDynamicLayer.Layers)
{
       if (subLayer.SubLayerIds == null)
       {
               // do something
       }
}
***********************************************

    Is there any better way?

    Thank you!

My development environment:
-- .Net 4
-- Silverlight 4
-- Visual Studio 2010
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
The type of sublayer is returned by the REST API when you request the REST point corresponding to 'All Layers' or to a specific layer : sample, documentation.

But AFAIK there is no support for that in the SL API so you will have to deserialize by yourself the result of the query.
0 Kudos