Query feature count and extent

This sample demonstrates how to query a feature table, in this case returning a count, for features that are within the visible extent or that meet specified criteria.

Query feature count or get the extent of matching features


Use the button to zoom to the extent of the state specified (by abbreviation) in the textbox or use the button to count the features in the current extent.


<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        <Entry Grid.Row="0" Grid.ColumnSpan="2" x:Name="txtStateEntry" Text="NH" />
        <Button Text="Zoom to matching features" Grid.Row="1" Grid.Column="0" Clicked="BtnZoomToFeatures_Click" />
        <Button Text="Count features in extent" Grid.Row="1" Grid.Column="1" Clicked="BtnCountFeatures_Click" />
        <Label Grid.Row="2" Grid.ColumnSpan="2" x:Name="txtResults" />
        <esriUI:MapView x:Name="MyMapView" Grid.Row="3" Grid.ColumnSpan="2" />

In this topic
  1. Instructions
  2. Code