Parameters
- oid
- Object id of the feature to lookup
- view
- The viewer whose scale or camera will be used
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
System.ArgumentNullException | MapView is null |
System.InvalidOperationException | Unsupported renderer type |
//Note: Run within QueuedTask.Run //Get the selection var selection = featureLayer.GetSelection(); //Get the first Object ID var firstOID = selection.GetObjectIDs().FirstOrDefault(); //Determine whether the layer's renderer type supports symbol lookup. if (featureLayer.CanLookupSymbol()) { //Looks up the symbol for the corresponding feature identified by the object id. var symbol = featureLayer.LookupSymbol(firstOID, MapView.Active); var jSon = symbol.ToJson(); //Create a JSON encoding of the symbol //Do something with symbol }
Target Platforms: Windows 11, Windows 10