Create a feature collection layer to show a query result from a service feature table.
Use case
Consider a national wireless telecommunications company who wants to improve connectivity within areas of poor coverage. Their cell towers, cell tower radii and state boundaries data are held within service feature tables, which can be queried for states that don't meet a certain threshold of coverage. The query result can be used to create and display a single feature collection layer for analysis of areas requiring improved coverage.
How to use the sample
When launched, this sample displays a map with point features as a feature collection layer. Pan and zoom to explore the map.
How it works
- Perform a query using the
QueryFeaturesAsync()
method on aServiceFeatureTable
. - Instantiate a
FeatureCollectionTable
with the result of the query. - Create a
FeatureCollection
and add the feature collection table to it. - Create a
FeatureCollectionLayer
from the feature collection. - Add the feature collection layer to the map's
OperationalLayers
list.
Relevant API
- FeatureCollection
- FeatureCollectionLayer
- FeatureCollectionTable
- FeatureLayer
- FeatureQueryResult
- FeatureTable
- QueryParameters
- ServiceFeatureTable
About the data
This application utilizes data from the wildfire feature service. It loads at full extent with features indicating wildfire response point features across the world.
Tags
layer, query, search, table
Sample Code
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.FeatureCollectionLayerFromQuery.FeatureCollectionLayerFromQuery"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
</Grid>
</ContentPage>