Display Device Location

This sample demonstrates how you can enable location services and switch between different types of auto pan modes.

Display device location

Code

<UserControl x:Class="ArcGISRuntime.WPF.Samples.DisplayDeviceLocation.DisplayDeviceLocation"
             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="300">
    <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 />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="Select autopan mode" 
                           Margin="0,0,0,2" TextWrapping="Wrap" />
                <ComboBox x:Name="modeChooser" SelectionChanged="OnModeChooserSelectionChanged" Grid.Row="1" Grid.ColumnSpan="2"/>
                <Button x:Name="StartButton" Click="OnStartButtonClicked" Content="Start" Margin="10, 5" Grid.Row="2"/>
                <Button x:Name="StopButton" Click="OnStopButtonClicked" Content="Stop" Margin="10,5" Grid.Row="2" Grid.Column="1"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code