Select to view content in your preferred language

MapLayer class unable to get layers on map

3861
0
02-16-2016 09:21 PM
Udaya_BhaskerCheerala
Emerging Contributor

Hi All,

As per ESRI ArcGIS Runtime for Windows Mobile 10.2.1 documentation, to get all layers on the map we need to use "MapLayers" class,

Below is the example Provided by ESRI(http://resources.arcgis.com/en/help/windows-mobile-sdk/apiref/index.html)

"Assuming you have a Map control called map1, and is using a valid MobileCache, the following example shows you how to get a MapLayer by index or layer name.

C# Copy Code

MapLayerCollection mlc = map1.MapLayers as MapLayerCollection;

// Method 1: get a MapLayer by index

MapLayer ml1 = mlc[0] as MapLayer;

MessageBox.Show(ml1.Name);

 

// Method 2: get a MapLayer by layer name

MapLayer ml2 = mlc["EditTest"] as MapLayer;

MessageBox.Show(ml2.Name); "

When we use the same example to access all the layers on map we are getting cache count only instead of layers count those are added on the map.

But in earlier version for the same code it was giving layers on the map. Hence we are unable to modify layer list(add or remove item). Please refer the attached screen shot.

Is there any work around to access map layers and end edit the list.

Thanks,

Uday

0 Kudos
0 Replies