Public Function GetSelection() As SelectionSet
public SelectionSet GetSelection()
Return Value
The selection in the map represented by the collection of layers and tables and their corresponding object ids.
Public Function GetSelection() As SelectionSet
public SelectionSet GetSelection()
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
// Loads the selected features into an Inspector instance.
// get the first layer and its corresponding selected feature OIDs
var firstSelectionSet = selectedFeatures.ToDictionary().First();
// create an instance of the inspector class
var inspector = new Inspector();
// load the selected features into the inspector using a list of object IDs
await inspector.LoadAsync(firstSelectionSet.Key, firstSelectionSet.Value);
}
// Retrieves the value of a specific attribute and the geometry of the first selected feature from the provided selection set. await QueuedTask.Run(() => { // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new Inspector(); // load the selected features into the inspector using a list of object IDs inspector.Load(firstSelectionSet.Key, firstSelectionSet.Value); //get the value of var pscode = inspector["STATE_NAME"]; var myGeometry = inspector.Shape; });
{
// Note: Needs QueuedTask to run
{
//Get the selected features from the map and filter out the standalone table selection.
var selectedFeatures = mapView.Map.GetSelection();
//Flash the collection of features.
mapView.FlashFeature(selectedFeatures);
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)