Find place

Find places near the current location
Loading

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:esri="using:Esri.ArcGISRuntime.UI.Controls">
    <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 Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>
                <TextBlock
                    Text="Enter a search term and a search location. Tap 'Search all' to find all results near that location. Tap 'Search in view' to restrict the search to results within the current visible extent."
                    Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
                    Margin="0,0,0,5"
                    FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Justify" />
                <TextBlock Text="Search:"
                           Grid.Row="1" Grid.Column="0"
                           Margin="0,5,0,0"
                           TextAlignment="Right" FontWeight="SemiBold"
                           VerticalAlignment="Center" />
                <TextBlock Text="Location:"
                           Grid.Row="2" Grid.Column="0"
                           Margin="0,5,0,0"
                           TextAlignment="Right" FontWeight="SemiBold"
                           VerticalAlignment="Center" />
                <AutoSuggestBox x:Name="SearchEntry"
                                Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
                                Text="Coffee"
                                Margin="5,5,0,0"
                                IsEnabled="False"
                                TextChanged="MySearchBox_TextChanged" />
                <AutoSuggestBox x:Name="LocationEntry" Text="Current Location"
                                Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
                                Margin="5,5,0,0"
                                IsEnabled="False"
                                TextChanged="MyLocationBox_TextChanged" />
                <Button x:Name="SearchButton"
                        Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch"
                        Content="Search all"
                        Margin="0,5,2.5,0"
                        IsEnabled="False"
                        Click="SearchButton_Click" />
                <Button x:Name="SearchViewButton"
                        Grid.Row="3" Grid.Column="2" HorizontalAlignment="Stretch"
                        Content="Search in view"
                        Margin="2.5,5,0,0"
                        IsEnabled="False"
                        Click="SearchViewButton_Click" />
                <ProgressBar x:Name="ProgressBar"
                             Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3"
                             IsIndeterminate="True"
                             Margin="0,5,0,0"
                             Visibility="Collapsed" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code