Select to view content in your preferred language

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

2839
1
08-28-2014 10:48 AM
KarstenRank
Frequent Contributor

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
Honored Contributor

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