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(); });
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.