public class ElevationLayerCreationParams : LayerCreationParams
Public Class ElevationLayerCreationParams Inherits LayerCreationParams
public class ElevationLayerCreationParams : LayerCreationParams
Public Class ElevationLayerCreationParams Inherits LayerCreationParams
//Note: call within QueuedTask.Run() //Define a ServiceConnection to use for the new Elevation surface var serverConnection = new CIMInternetServerConnection { Anonymous = true, HideUserProperty = true, URL = "https://elevation.arcgis.com/arcgis/services" }; CIMAGSServiceConnection serviceConnection = new CIMAGSServiceConnection { ObjectName = "WorldElevation/Terrain", ObjectType = "ImageServer", URL = "https://elevation.arcgis.com/arcgis/services/WorldElevation/Terrain/ImageServer", ServerConnection = serverConnection }; //Defines a new elevation source set to the CIMAGSServiceConnection defined above //At 2.x - var newElevationSource = new ArcGIS.Core.CIM.CIMElevationSource //{ // VerticalUnit = ArcGIS.Core.Geometry.LinearUnit.Meters, // DataConnection = serviceConnection, // Name = "WorldElevation/Terrain", // Visibility = true //}; //The elevation surface //At 2.x - var newElevationSurface = new ArcGIS.Core.CIM.CIMMapElevationSurface //{ // Name = "New Elevation Surface", // BaseSources = new ArcGIS.Core.CIM.CIMElevationSource[1] { newElevationSource }, // Visibility = true, // ElevationMode = ElevationMode.CustomSurface, // VerticalExaggeration = 1, // EnableSurfaceShading = false, // SurfaceTINShadingMode = SurfaceTINShadingMode.Smooth, // Expanded = false, // MapElevationID = "{3DEC3CC5-7C69-4132-A700-DCD5BDED14D6}" //}; //Get the active map var map = MapView.Active.Map; //Get the elevation surfaces defined in the map //At 2.x - var listOfElevationSurfaces = definition.ElevationSurfaces.ToList(); var listOfElevationSurfaces = map.GetElevationSurfaceLayers(); //Add the new elevation surface //At 2.x - listOfElevationSurfaces.Add(newElevationSurface); var elevationLyrCreationParams = new ElevationLayerCreationParams(serviceConnection); var elevationSurface = LayerFactory.Instance.CreateLayer<ElevationSurfaceLayer>( elevationLyrCreationParams, map);
// wrap in QueuedTask.Run // surfaceLayer could also be the ground layer string uri = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"; var createParams = new ElevationLayerCreationParams(new Uri(uri)); createParams.Name = "Terrain 3D"; var eleSourceLayer = LayerFactory.Instance.CreateLayer<Layer>(createParams, surfaceLayer);
System.Object
ArcGIS.Desktop.Mapping.BaseCreationParams
ArcGIS.Desktop.Mapping.MapMemberCreationParams
ArcGIS.Desktop.Mapping.LayerCreationParams
ArcGIS.Desktop.Mapping.ElevationLayerCreationParams
Target Platforms: Windows 11, Windows 10