Does IdentifyLayerAsync Method also support FeatureCollectionLayer?
https://developers.arcgis.com/net/latest/forms/guide/identify-features.htm
The GeoElement list is empty.
var layer = MyMapView.Map.OperationalLayers[0];
var pixelTolerance = 20;
var returnPopupsOnly = true;
var maxResults = 1;
var idResults = await MyMapView.IdentifyLayerAsync(layer, e.Position, pixelTolerance, returnPopupsOnly, maxResults);
foreach (GeoElement idElement in idResults.GeoElements)
{
Feature idFeature = idElement as Feature;
//idLayer.SelectFeature(idFeature);
}
FeatureCollectionLayer idLayer = idResults.LayerContent as FeatureCollectionLayer;
FeatureCollectionTable tables = (idLayer.FeatureCollection.Tables).FirstOrDefault();
var fields = tables.LayerInfo.Fields;
The FeatureCollectionLayer is a group layer of FeatureLayers, so instead parse in the layers inside the collection. Ie
var sublayer = ((FeatureCollectionLayer)layer).Layers[0];
var idResults = await MyMapView.IdentifyLayerAsync(sublayer, e.Position, pixelTolerance, returnPopupsOnly, maxResults);
...actually did you look at the idResults.SublayerResults ? Come to think of it, your geoelements might just be in there.
Hello Morten,
Thank you for the information.
var layer = MyMapView.Map.OperationalLayers[0];
var idResults = await MyMapView.IdentifyLayerAsync(layer, e.Position, pixelTolerance, returnPopupsOnly, maxResults);
We were able to get elements of GeoElements from idResults.SublayerResults.
Thank you very much!