ArcGIS Runtime SDK for .NET Samples

Distance measurement analysis

Measure distance in a scene view
Loading

Code

<UserControl
    x:Class="ArcGISRuntime.UWP.Samples.DistanceMeasurement.DistanceMeasurement"
    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:esriUI="using:Esri.ArcGISRuntime.UI.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="Margin" Value="0,5,0,5" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </UserControl.Resources>
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
        <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" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <!-- Labels -->
                <TextBlock x:Name="HelpTextBlock"
                       Foreground="Red"
                       TextWrapping="WrapWholeWords"
                       Text="Tap 'New measurement' to start."
                       Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" />
                <TextBlock Text="Direct" 
                       Grid.Row="1" Grid.Column="0" />
                <TextBlock Text="Horizontal"
                       Grid.Row="2" Grid.Column="0" />
                <TextBlock Text="Vertical"
                       Grid.Row="3" Grid.Column="0" />

                <!-- Controls -->
                <TextBlock x:Name="DirectMeasureTextBlock"
                       Grid.Row="1" Grid.Column="1" />
                <TextBlock x:Name="HorizontalMeasureTextBlock"
                       Grid.Row="2" Grid.Column="1" />
                <TextBlock x:Name="VerticalMeasureTextBlock"
                       Grid.Row="3" Grid.Column="1" />
                <ComboBox x:Name="UnitSystemCombo"
                          Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"
                          HorizontalAlignment="Stretch"
                          Margin="0,5,0,5"
                          />
                <Button x:Name="NewMeasureButton"
                        Content="New measurement"
                        IsEnabled="False"
                        Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2"
                        HorizontalAlignment="Stretch"
                        Margin="0,5,0,0"
                        Click="NewMeasureButton_OnClick" />
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code