ArcGIS Runtime SDK for .NET (BETA) count graphiclayers?

2751
1
08-28-2014 10:48 AM
KarstenRank
Occasional Contributor III

Hello,

 

i'm new to SDk for .net. I wrote an windows desktop application, that shows csv-files (csvLayer) per drag and drop.

 

 

How can I count, how many csvLayers are on the map?

 

Thanks a lot

 

Karsten

0 Kudos
1 Reply
FreddieGibson
Occasional Contributor III

Have you tried iterating through the layers of the Map and counting the number of layers that are of type CsvLayer? I would think that you could do either of the following to accomplish this.

Option A

var count = 0;
foreach (var layer in MyMapView.Map.Layers) {
     if (layer is CsvLayer)
          count += 1;
}

​Option B

var count = MyMapView.Map.Layers.OfType<CsvLayer>().Count(); // Linq expression
0 Kudos