View in MAUI UWP WPF WinUI View on GitHub
import InlineCode from "@esri-dx/starship-doc-components/components/InlineCode.astro";

Display an OGC API feature collection and query features while navigating the map view.

Image of display OGC API collection

Use case

When panning the map view, it may be necessary to query the OGC API feature table for additional features within the new visible extent.

How to use the sample

Pan the map and observe how new features are loaded from the OGC API feature service.

How it works

  1. Create an
    object using a URL to an OGC API feature service and a collection ID.
  2. Set the feature table’s
    property to
    .
  3. Call
  4. Create a
    using the feature table and add it to the map view.
  5. Every time the map view navigation completes:
    1. Create
      .
    2. Set the parameter’s
      to the current extent of the map view.
    3. Set the parameter’s
      property to
      .
    4. Set the
      property to 5000 (some services have a low default value for maximum features).
    5. Call
      using the query parameters from the previous steps.

Relevant API

  • OgcFeatureCollectionTable
  • QueryParameters

About the data

The Daraa, Syria test data is OpenStreetMap data converted to the Topographic Data Store schema of NGA.

Additional information

See the OGC API website for more information on the OGC API family of standards.

Tags

feature, feature layer, feature table, OGC, OGC API, service, table, web

Sample Code

DisplayOACollection.xaml DisplayOACollection.xaml DisplayOACollection.xaml.cs
<UserControl x:Class="ArcGIS.WinUI.Samples.DisplayOACollection.DisplayOACollection"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
<Grid>
<esriUI:MapView x:Name="MyMapView" />
<Border Style="{StaticResource BorderStyle}">
<StackPanel>
<TextBlock Text="Pan and zoom to see features." />
<ProgressBar x:Name="LoadingProgressBar"
Margin="5"
IsIndeterminate="True" />
</StackPanel>
</Border>
</Grid>
</UserControl>