Find a route

This sample demonstrates how to solve for the best route between two locations on the map and display driving directions between them.

Route and driving directions

Code

<UserControl 
    x:Class="ArcGISRuntime.UWP.Samples.FindRoute.FindRoute"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:MapView x:Name="MyMapView"/>
        <Border Background="LightGray" Opacity=".85" BorderBrush="Black" BorderThickness="1"
                HorizontalAlignment="Left" VerticalAlignment="Top"
                Margin="30" Padding="20" Width="375">
            <StackPanel>
                <TextBlock Text="Route directions:" 
                           Margin="0,0,0,2" />
                <ListView x:Name="DirectionsListBox"
                         Width="325" Height="300">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding DirectionText}"/>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <Button x:Name="SolveRouteButton"
                        HorizontalAlignment="Stretch"
                        Height="30"
                        Margin="0,5"
                        Content="Solve Route"
                        Click="SolveRouteClick"/>
                <Button x:Name="ResetButton"
                        HorizontalAlignment="Stretch"
                        Height="30"
                        Content="Reset"
                        Click="ResetClick"/>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code