ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / HasPreviousCamera Method
Example

In This Topic
    HasPreviousCamera Method
    In This Topic
    Indicates whether the map view has a previous camera position.
    Syntax
    public bool HasPreviousCamera()
    Public Function HasPreviousCamera() As Boolean

    Return Value

    Returns true if the map view has a previous camera position.
    Remarks
    The map view will have a previous camera position if the camera has changed before, and if the camera stack has not been rewound to the beginning.
    Example
    Go To Previous Camera
    public Task<bool> ZoomToPreviousCameraAsync()
    {
      //Get the active map view.
      var mapView = MapView.Active;
      if (mapView == null)
        return Task.FromResult(false);
    
      //Zoom to the selected layers in the TOC
      if (mapView.HasPreviousCamera())
        return mapView.PreviousCameraAsync();
    
      return Task.FromResult(false);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also