ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Presentations Namespace / Presentation Class / AddMapPage Method / AddMapPage(MapView,Int32) Method
A map view
The insert position. If -1, the page is added to the end of the page collection. If 0, the page is added to the beginning of the page collection.
Example

In This Topic
    AddMapPage(MapView,Int32) Method
    In This Topic
    Adds a new map page to the presentation based on a map view. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function AddMapPage( _
       ByVal mapView As MapView, _
       ByVal insertIndex As Integer _
    ) As MapPresentationPage

    Parameters

    mapView
    A map view
    insertIndex
    The insert position. If -1, the page is added to the end of the page collection. If 0, the page is added to the beginning of the page collection.

    Return Value

    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run.
    Example
    Map page
    //Must be on QueuedTask
    await QueuedTask.Run(() =>
    {
      // retrieve a map from the project based on the map name
      MapProjectItem mpi = Project.Current.GetItems<MapProjectItem>()
                                 .FirstOrDefault(m => m.Name.Equals("Your Map Name", StringComparison.CurrentCultureIgnoreCase));
      Map map = mpi.GetMap();
      //create a map page using map's default extent
      presentation.AddMapPage(map, -1);
    
      //create a page using map's bookmark
      Bookmark bookmark = map.GetBookmarks().FirstOrDefault(
                   b => b.Name == "Your bookmark"); // get the bookmark based on the bookmark's name
      presentation.AddMapPage(bookmark, -1);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also