I'm upgrading from arcgisRuntime .NET SDK 10.2.5 to 100.9.0. I am trying to find a suitable replacement for code like this:
string whereClause = "RouteID = 100" //Actually changes based on user interaction
ServiceFeatureTable serviceFeatureTable = featureLayer.FeatureTable as ServiceFeatureTable;
serviceFeatureTable.Where = whereClause;
The intent is we only show a handful (usually only 1) of the features in the feature layer. The where clause is actually built dynamically based on what the user is doing. The closest I can find is setting visibility on the features, but first I have to find all the other features and set their visibility as false:
//Hide All Features
QueryParameters queryParams = new QueryParameters();
queryParams.WhereClause = "1 = 1";
queryParams.MaxFeatures = Int32.MaxValue; //Doesn't seem to work
FeatureQueryResult allFeatures = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);
long l = allFeatures.Count(); // Just for debugging
//Show features matching query
string whereClause = "RouteID = 100"
queryParams = new QueryParameters();
queryParams.WhereClause = whereClause;
FeatureQueryResult filterResults = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);
And this actually doesn't work either because it looks like the max number of features returned is 1000. It also seems very inefficient. Is there more straightforward way of hiding all the features except those that match a SQL type query?
Solved! Go to Solution.