ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ElevationSurfaceLayer Class
Members Example Version

ElevationSurfaceLayer Class
Represents an elevation surface layer in the map or scene.
Object Model
ElevationSurfaceLayer ClassLayer ClassCIMColor ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassElevationTypeDefinition ClassSpatialReference ClassTimeParameters ClassSurfaceZsResult ClassMap ClassILayerContainer InterfaceEnvelope Class
Syntax
Example
Create a New Elevation Surface
//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);
Get the elevation surface layers and elevation source layers from a map
// retrieve the elevation surface layers in the map including the Ground
var surfaceLayers = map.GetElevationSurfaceLayers();

// retrieve the single ground elevation surface layer in the map
var groundSurfaceLayer = map.GetGroundElevationSurfaceLayer();

// determine the number of elevation sources in the ground elevation surface layer
int numberGroundSources = groundSurfaceLayer.Layers.Count;
// get the first elevation source layer from the ground elevation surface layer
var groundSourceLayer = groundSurfaceLayer.Layers.FirstOrDefault();
Find an elevation surface layer
var surfaceLayers = map.GetElevationSurfaceLayers();
var surfaceLayer = surfaceLayers.FirstOrDefault(l => l.Name == "Surface2");

surfaceLayer = map.FindElevationSurfaceLayer(layerUri);
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
      ArcGIS.Desktop.Mapping.MapMember
         ArcGIS.Desktop.Mapping.Layer
            ArcGIS.Desktop.Mapping.CompositeLayer
               ArcGIS.Desktop.Mapping.ElevationSurfaceLayer

Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also