Hi,
I have tried to display the Daara TransportationGroundCrv Collection in my WinUI Project. I have a problem where every time I call OgcFeatureCollectionTable.PopulateFromServiceAsync the selection on the layer changes seemingly randomly.
As described in the Display OGC API collection sample, I call PopulateFromServiceAsync on the MapView.NavigationCompleted Event. The Features are populated correctly but the selection somehow changes. This is my code:
var selectedFeatures = await featureLayer.GetSelectedFeaturesAsync();
_logger.LogInformation(" Before: Selected Feature: Count {count}, Attributes {attributes}", selectedFeatures.Count(),
string.Join(", \n", selectedFeatures.FirstOrDefault()?.Attributes.Select(a => $"{a.Key}: {a.Value}") ?? []));
await ogcFeatureTable.PopulateFromServiceAsync(wfsVisibleExtentQuery, true, null, ct);
selectedFeatures = await featureLayer.GetSelectedFeaturesAsync();
_logger.LogInformation(" After: Selected Feature: Count {count}, Attributes {attributes}", selectedFeatures.Count(),
string.Join(", \n", selectedFeatures.FirstOrDefault()?.Attributes.Select(a => $"{a.Key}: {a.Value}") ?? []));The selected feature before calling PopulateFromServiceAsync is not the same as the selected feature after calling PopulateFromServiceAsync.
I want the feature selection because I display the attributes of the selected feature, and I want the user to be able to see which feature is selected. The selection is implemented using mapView.IdentifyLayerAsync and featureLayer.SelectFeature
The OgcFeatureCollectionTable is initialized as follows:
var ogcFeatureTable = new OgcFeatureCollectionTable(new Uri("https://demo.ldproxy.net/daraa"), "TransportationGroundCrv")
{
FeatureRequestMode = FeatureRequestMode.ManualCache,
};
new FeatureLayer(ogcFeatureTable)I'm using net8.0 WinUI and Esri.ArcGISRuntime.WinUI 200.6.0
Could this be a bug in the ArcGIS Runtime?