Query with a Buffer Online

This sample demonstrates using a geometry service to generate query geometry. To use the sample, simply click on the map. The click point will be buffered and parcels that intersect the buffer will be retrieved and drawn.

In the code-behind, a GeometryService is used to generate the buffer from the click point. A QueryTask is then used to perform a query using the buffer geometry.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.BufferQuery"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.Resources>
            <esri:PictureMarkerSymbol x:Key="DefaultMarkerSymbol" OffsetX="11" OffsetY="39" Source="/Assets/Images/i_pushpin.png" />
            <esri:SimpleFillSymbol x:Key="BufferSymbol" Fill="#66BB0000" BorderBrush="#88CC0000" BorderThickness="2"  />
            <esri:SimpleFillSymbol x:Key="ParcelSymbol" Fill="#440000FF" BorderBrush="Blue" BorderThickness="2" />
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>

        <esri:Map x:Name="MyMap" Background="White" WrapAround="True"
                  Extent="-9270434.248,5246977.326,-9269261.417,5247569.712" 
                  MouseClick="MyMap_MouseClick">
            <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
                      Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:GraphicsLayer ID="MyResultsGraphicsLayer">
                <esri:GraphicsLayer.MapTip>
                    <Border BorderBrush="DarkGray" Background="Azure" CornerRadius="3" BorderThickness="1" Padding="3">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="Owner:" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Black"  />
                            <TextBlock Text="{Binding [OWNERNME1]}" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Black"  />
                        </StackPanel>
                    </Border>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
            <esri:GraphicsLayer ID="MyGraphicsLayer" IsHitTestVisible="False"/>
        </esri:Map>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray" RadiusX="10" RadiusY="10"  Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <TextBlock x:Name="InformationTextBlock" 
                 Text="Click on map to set a location. A buffer will used to display parcels within 100 meters of the location." 
                 Width="200" Margin="30,20,30,25" HorizontalAlignment="Left" TextWrapping="Wrap" Foreground="Black" />
        </Grid>

    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014