AnsweredAssumed Answered

How to determine the number of the layer by it's name

Question asked by aviabunin on Dec 30, 2014
Latest reply on Dec 30, 2014 by aviabunin

Dear Gurus!

In some  tasks you must specify the LayerIds. How to define it when I know it's name?

For example in Identify task I use code:

            ESRI.ArcGIS.Client.Tasks.IdentifyParameters identifyParams = new IdentifyParameters()
            {
                Geometry = clickPoint,
                MapExtent = Map.Extent,
                Width = (int)Map.ActualWidth,
                Height = (int)Map.ActualHeight,
                LayerOption = LayerOption.all,
                SpatialReference = Map.SpatialReference
                ,
                Tolerance = 30
            };
            identifyParams.LayerIds.Add(2);
            identifyParams.LayerIds.Add(3);

But sometimes  it is necessary to change the sequence of layers before the next publication.

Outcomes