ArcGIS Pro 2.6 API Reference Guide
SpatialReference Property (Camera)

ArcGIS.Desktop.Mapping Namespace > Camera Class : SpatialReference Property
Gets or sets the Spatial Reference of the Camera. This property applies to both 2D and 3D views.
public SpatialReference SpatialReference {get; set;}
Public Property SpatialReference As SpatialReference
X, Y, Z, and SpatialReference describe the position of the viewing location. Setting an appropriate spatial reference for the position of the camera allows the camera to be applied across views with different spatial references. The camera's relative location to the Earth remains unchanged. Project the camera if its spatial reference has a different datum than the map's spatial reference using the ArcGIS.Core.Geometry api. If the spatial reference is null the camera assumes the spatial reference of the map to which it is applied.
Project a camera into a new spatial reference.
public Task<Camera> ProjectCamera(Camera camera, ArcGIS.Core.Geometry.SpatialReference spatialReference)
  return QueuedTask.Run(() =>
    var mapPoint = MapPointBuilder.CreateMapPoint(camera.X, camera.Y, camera.Z, camera.SpatialReference);
    var newPoint = GeometryEngine.Instance.Project(mapPoint, spatialReference) as MapPoint;
    var newCamera = new Camera()
      X = newPoint.X,
      Y = newPoint.Y,
      Z = newPoint.Z,
      Scale = camera.Scale,
      Pitch = camera.Pitch,
      Heading = camera.Heading,
      Roll = camera.Roll,
      Viewpoint = camera.Viewpoint,
      SpatialReference = spatialReference
    return newCamera;

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also


Camera Class
Camera Members