ArcGIS Runtime SDK for .NET Samples

Viewshed (Location)

Show visible areas in a scene view
Loading

Code

<UserControl
    x:Class="ArcGISRuntime.UWP.Samples.ViewshedLocation.ViewshedLocation"
    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">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
        <Border
            Background="White" BorderBrush="Black" BorderThickness="1"
            HorizontalAlignment="Right" VerticalAlignment="Top"
            Margin="30" Padding="20" Width="350">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Heading</TextBlock>
                <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Pitch</TextBlock>
                <TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Horizontal Angle</TextBlock>
                <TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Vertical Angle</TextBlock>
                <TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Height</TextBlock>
                <TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Minimum Distance</TextBlock>
                <TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Maximum Distance</TextBlock>
                <TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Frustum Visibility</TextBlock>
                <TextBlock Grid.Row="8" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,9">Analysis Visibility</TextBlock>

                <Slider Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="0" Maximum="360" SnapsTo="StepValues" StepFrequency="1"  x:Name="HeadingSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="60" Maximum="180"  SnapsTo="StepValues" StepFrequency="1" x:Name="PitchSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="75" Maximum="120" Minimum="1" SnapsTo="StepValues" StepFrequency="1" x:Name="HorizontalAngleSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="90" Maximum="120" Minimum="1" SnapsTo="StepValues" StepFrequency="1" x:Name="VerticalAngleSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="4" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="10" Maximum="200" Minimum="0" x:Name="HeightSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="5" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="5" Maximum="8999" Minimum="5" x:Name="MinimumDistanceSlider" ValueChanged="HandleSettingsChange" />
                <Slider Grid.Row="6" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Value="1500" Minimum="1" Maximum="9999" x:Name="MaximumDistanceSlider" ValueChanged="HandleSettingsChange" />
                <CheckBox Grid.Row="7" Grid.Column="2" x:Name="FrustumVisibilityCheck" VerticalAlignment="Center" Checked="HandleSettingsChange" Unchecked="HandleSettingsChange" />
                <CheckBox Grid.Row="8" Grid.Column="2" x:Name="AnalysisVisibilityCheck" VerticalAlignment="Center" Checked="HandleSettingsChange" Unchecked="HandleSettingsChange" IsChecked="True" />

                <TextBlock Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Foreground="Red">Click to change the viewshed location.</TextBlock>
            </Grid>
        </Border>
    </Grid>
</UserControl>


In this topic
  1. Code