ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / AddBookmark Method / AddBookmark(MapView,String,String) Method
The map view used to create the bookmark.
The name of the new bookmark.
The description of the new bookmark.
Example

In This Topic
    AddBookmark(MapView,String,String) Method
    In This Topic
    Creates a new bookmark using the current location and time of the map view. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function AddBookmark( _
       ByVal mapView As MapView, _
       ByVal name As String, _
       ByVal description As String _
    ) As Bookmark

    Parameters

    mapView
    The map view used to create the bookmark.
    name
    The name of the new bookmark.
    description
    The description of the new bookmark.

    Return Value

    The new bookmark added to the map.
    Exceptions
    ExceptionDescription
    The MapView must contain this Map and the name of the Bookmark must be unique for the Map.
    The MapView cannot be null.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Add New Bookmark from MapView
    public Task<Bookmark> AddBookmarkAsync(string name)
    {
      return QueuedTask.Run(() =>
      {
        //Get the active map view.
        var mapView = MapView.Active;
        if (mapView == null)
          return null;
    
        //Adding a new bookmark using the active view.
        return mapView.Map.AddBookmark(mapView, name);
      });
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also