Find Place

This sample demonstrates how to use geocode functionality to search for points of interest, around a location or within an extent.

Find places near the current location

Instructions

  1. Enter a point of interest you'd like to search for (e.g. Starbucks)
  2. Enter a search location or accept the default Current Location
  3. Select search all to get all results, or press search view to only get results within the current extent.

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.FindPlace.FindPlace"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid>
        <esri:MapView x:Name="MyMapView" />
        <Border
                Background="White" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Right" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition Height="20" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <Label Content="Search" Grid.Row="0" Grid.Column="0" />
                <Label Content="Location" Grid.Row="1" Grid.Column="0" />
                <ComboBox x:Name="MySearchBox" Text="Coffee"
                          Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
                          IsEnabled="False" IsEditable="True"
                          TextBoxBase.TextChanged="MySearchBox_TextChanged" />
                <ComboBox x:Name="MyLocationBox" Text="Current Location"
                          Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
                          IsEditable="True" IsEnabled="False"
                          TextBoxBase.TextChanged="MyLocationBox_TextChanged" />
                <Button x:Name="MySearchButton" Content="Search All"
                        Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
                        IsEnabled="False"
                        Click="MySearchButton_Click" />
                <Button x:Name="MySearchRestrictedButton" Content="Search in View"
                        Grid.Row="2" Grid.Column="2"
                        IsEnabled="False"
                        Click="MySearchRestrictedButton_Click" />
                <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" 
                        Visibility="Hidden" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code