ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / PanToAsync Method / PanToAsync(Bookmark,Nullable<TimeSpan>) Method
The bookmark containing the position in which to pan.
The amount of time to navigate the view to the new camera position. If null it uses the default navigation duration.
Example

In This Topic
    PanToAsync(Bookmark,Nullable<TimeSpan>) Method
    In This Topic
    Pan the view to the position defined in a bookmark.
    Syntax
    Public Overloads Function PanToAsync( _
       ByVal bookmark As Bookmark, _
       Optional ByVal duration As Nullable(Of TimeSpan) _
    ) As Task(Of Boolean)

    Parameters

    bookmark
    The bookmark containing the position in which to pan.
    duration
    The amount of time to navigate the view to the new camera position. If null it uses the default navigation duration.

    Return Value

    True if the navigation is completed, false if it was interrupted by another view navigation.
    Remarks
    Pan in 2D maintains the current camera scale and heading and modifies the X and Y position. Pan in 3D maintains the current camera pitch and heading and modifies the X and Y position.
    Example
    Pan To Bookmark Async
    {
      //Get the first bookmark with the given name.
      var bookmark = mapView.Map.GetBookmarks().FirstOrDefault(b => b.Name == bookmarkName);
      if (bookmark == null)
      {
        // Manage the error - bookmark not found
      }
    
      //Pan the view to the bookmark.
      mapView.PanToAsync(bookmark, TimeSpan.FromSeconds(2));
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also