AnsweredAssumed Answered

How to get a graphic when using a feature layer to display points

Question asked by Kayuga.Solution on Mar 29, 2018
Latest reply on Mar 29, 2018 by twakim-esristaff

When the user clicks on a graphic which is displayed on our map I would like to display some information about the object the graphic represents.  We're using a feature layer to display the graphics as in:

_featureLayer = new FeatureLayer(_featureTable);  // create the feature layer

_featureLayer.Opacity = 0.6;  // Set the Opacity of the Feature Layer
_featureLayer.Renderer = new SimpleRenderer(new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Colors.Red, 10d));  // Set feature layer renderer
myMap.OperationalLayers.Add(_featureLayer); // Add feature layer to the map
myMapView.Map = myMap; // Assign the map to the MapView

 

There is no graphics overlay so we can't use IdentifyGraphicsOverlayAsync to see which graphic was clicked on as in:

 

// Don't have graphicsOverlay

var results = await myMapView.IdentifyGraphicsOverlayAsync(graphicsOverlay, e.Position, 1d, false, 1);
var graphic = results.Graphics?.FirstOrDefault();

 

Is there a way to get this information from the feature layer or a way to get a graphics overlay from a map created from a feature service?

Outcomes