As stated in the title, I'm looking to retrieve the number displayed for feature counts in legends within a layout. How can I achieve this?
How to get this counts
You can get the number of features in a layer using the Pro API's, FeatureClass.GetCount() method.
var featureLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(n => n.Name == "TestPoly"); QueuedTask.Run( () => { var featureClass = featureLayer.GetFeatureClass(); var count = featureClass.GetCount(); });
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.