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.UWP.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="using:Esri.ArcGISRuntime.UI.Controls"
    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 />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="Search"
                           Grid.Row="0" Grid.Column="0" />
                <TextBlock Text="Location"
                           Grid.Row="1" Grid.Column="0" />
                <AutoSuggestBox x:Name="MySearchBox" Text="Coffee"
                                Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
                                IsEnabled="False"
                                TextChanged="MySearchBox_TextChanged" />
                <AutoSuggestBox x:Name="MyLocationBox" Text="Current Location"
                                Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
                                IsEnabled="False"
                                TextChanged="MyLocationBox_TextChanged" />
                <Button x:Name="MySearchButton" Content="Search All"
                        Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch"
                        IsEnabled="False"
                        Click="MySearchButton_Click" />
                <Button x:Name="MySearchRestrictedButton" Content="Search in View"
                        Grid.Row="2" Grid.Column="2" HorizontalAlignment="Stretch"
                        IsEnabled="False"
                        Click="MySearchRestrictedButton_Click" />
                <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3"
                        Visibility="Collapsed" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Instructions
  2. Code