ArcGIS Pro SDK -Click a Feature on a Map and have the Name Displayed in a Pane

367
3
07-29-2019 09:22 AM
thomasbales
Occasional Contributor

Does anybody know how to interact with the MapView and have values passed back to a pane using the ArcGIS Pro SDK? I need to click a feature and have the name displayed in a xaml pane. Once I can do this the rest of the modules methods I will be able to figure out.

Tom

Tags (1)
Reply
0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Tom, 

 You need a MapTool to do this.  I added a sample of a simple map tool which displays feature data on a dockpane here:  https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/MapToolIdentify...  The map tool calls OnSketchCompleteAsync with the sketched geometry (as a parameter) by the operator (point, line, poly ...) and you can use that method to find the features contained by that geometry and then display result information in your WPF user control (dockpane, window etc.)

- Wolf 

JohnJones
Occasional Contributor

In addition to the sample above you may want to make use of QueryDisplayExpressions (on both BasicFeatureLayer & StandaloneTable through ArcGIS.Desktop.Mapping.IDisplayTable) as this will retrieve the display expression strings for features (by ObjectID) that is meant to be the canonical string representation of that feature for use in UI (and is controlled by a layer defined script).  Perhaps this sample could be enhanced to use this approach.

LORAMAdmin
New Contributor II

Thanks so much!!!

Tom

Reply
0 Kudos