I've been trying to follow a few ArcGIS Runtime 100.1 tutorials and samples. Basically I want to display a SLPK in a Scene. The SLPK has a LAS Dataset inside it. Is this supported yet? I seem to remember point clouds not being supported in previous releases. Morten Nielsen
MainWindow.xaml.cs
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime;
using System.Threading;
using System;
namespace SLPK_TEST_NET_V1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
// Execute initialization
Initialize();
}
public void Initialize()
{
// Create new Scene
Scene myScene = new Scene();
// Set Scene's base map property
myScene.Basemap = Basemap.CreateImagery();
// Create new scene layer from the url
ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer();
Uri sceneURI = new Uri(@"C:\\Miscellaneous\\SLPK Test\\4043695.slpk");
sceneLayer.Source = sceneURI;
sceneLayer.LoadStatusChanged += myScene_LoadStatusChanged;
loadStatusLabel.Content = sceneLayer.LoadStatus.ToString();
if (sceneLayer.LoadStatus == LoadStatus.Loaded)
{
double lat = sceneLayer.FullExtent.GetCenter().X;
double lon = sceneLayer.FullExtent.GetCenter().Y;
double height = sceneLayer.FullExtent.GetCenter().Z;
// Add created layer to the operational layers collection
myScene.OperationalLayers.Add(sceneLayer);
// Create a camera with coordinates showing layer data
Camera camera = new Camera(lat, lon, height, 345, 65, 0);
// Assign the Scene to the SceneView
MySceneView.Scene = myScene;
// Set view point of scene view using camera
MySceneView.SetViewpointCameraAsync(camera);
}
}
void myScene_LoadStatusChanged(object sender, Esri.ArcGISRuntime.LoadStatusEventArgs e)
{
// Update the load status information
Dispatcher.BeginInvoke(
new ThreadStart(() =>
loadStatusLabel.Content = string.Format("Scene Layer' load status : {0}", e.Status.ToString())
));
}
}
}
MainWindow.xaml
<Window x:Class="SLPK_TEST_NET_V1.MainWindow"
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"
SizeToContent="WidthAndHeight"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<esri:SceneView x:Name="MySceneView"/>
<StackPanel Orientation="Horizontal">
<Label x:Name="loadStatusLabel" Content="Scene Layer' load status : " Background="Yellow"/>
</StackPanel>
</Grid>
</Window>