ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / SetViewingModeAsync Method
Example

In This Topic
    SetViewingModeAsync Method
    In This Topic
    Set the perspective of the map view..
    Syntax
    Public Function SetViewingModeAsync( _
       ByVal viewingMode As MapViewingMode _
    ) As Task
    public Task SetViewingModeAsync( 
       MapViewingMode viewingMode
    )

    Parameters

    viewingMode
    Exceptions
    ExceptionDescription
    Map can only be set for 2D views and SceneLocal and SceneGlobal can only be set for 3D views.
    Remarks
    A map view can be used to show maps which display 2D data or scenes which display 3D data. This method can be used to switch between Local and Global for 3D.
    Example
    Set ViewingMode
    {
      //Check if the view can be set to SceneLocal and if it can set it.
      var result = mapView.CanSetViewingMode(MapViewingMode.SceneLocal);
      if (result)
        mapView.SetViewingModeAsync(MapViewingMode.SceneLocal);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also