Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS Runtime SDK for .NET

3D KML Layer

Download Samples Repository

Description

This sample demonstrates adding a KML to a Scene in XAML.

"Desktop" "Store" Available for Desktop, Store

Sample Code

<UserControl x:Class="ArcGISRuntime.Samples.Desktop.KMLLayerSample3d"
			 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:esri="http://schemas.esri.com/arcgis/runtime/2013"
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 mc:Ignorable="d" >
	<Grid>
		<esri:SceneView x:Name="MySceneView">
			<esri:Scene x:Name="MyScene">
				<esri:Scene.Surface>
					<esri:ServiceElevationSource ServiceUri="http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer" 
												 IsEnabled="True" />
				</esri:Scene.Surface>
				<esri:ArcGISTiledMapServiceLayer ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer"/>
				<!--Add KML Layer for June 19, 2015-->
				<esri:KmlLayer SourceUri="http://activefiremaps.fs.fed.us/data/kml/conus_hist/conus_20150619.kmz"/>
			</esri:Scene>
		</esri:SceneView>
	</Grid>
</UserControl>
using Esri.ArcGISRuntime.Controls;
using Esri.ArcGISRuntime.Geometry;
using System;
using System.Windows.Controls;

namespace ArcGISRuntime.Samples.Desktop
{
	/// <summary>
	/// This sample demonstrates adding a KML to a Scene in XAML.
	/// </summary>
	/// <title>3D KML Layer</title>
	/// <category>Scene</category>
	/// <subcategory>Layers</subcategory>
	public partial class KMLLayerSample3d : UserControl
	{
		public KMLLayerSample3d()
		{
			InitializeComponent();
			Initialize();
		}

		public async void Initialize()
		{
			await MySceneView.SetViewAsync(new Camera(new MapPoint(-116.799471, 34.039555, 12819.401), 0, 40.49));
		}
	}
}
Feedback on this topic?