Select to view content in your preferred language

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

08-28-2014 10:48 AM
Occasional Contributor III



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



0 Kudos
1 Reply
Regular Contributor II

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