ArcGISRuntime.UWP.Samples.FeatureCollectionLayerFromQuery.FeatureCollectionLayerFromQuery.GetFeaturesFromQuery C# (CSharp) Method

GetFeaturesFromQuery() private method

private GetFeaturesFromQuery ( ) : void
return void
        private async void GetFeaturesFromQuery()
        {
            // Create a service feature table to get features from
            var featTable = new ServiceFeatureTable(new Uri(FeatureLayerUrl));

            // Create a query to get all features in the table
            var queryParams = new QueryParameters();
            queryParams.WhereClause = "1=1";

            // Query the table to get all features
            var featureResult = await featTable.QueryFeaturesAsync(queryParams);

            // Create a new feature collection table from the result features
            var collectTable = new FeatureCollectionTable(featureResult);

            // Create a feature collection and add the table
            var featCollection = new FeatureCollection();
            featCollection.Tables.Add(collectTable);

            // Create a layer to display the feature collection, add it to the map's operational layers
            var featCollectionTable = new FeatureCollectionLayer(featCollection);
            MyMapView.Map.OperationalLayers.Add(featCollectionTable);
        }
    }