ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IMapFactory Interface / CreateMapFromItem Method
An ArcGIS.Desktop.Core.Item

In This Topic
    CreateMapFromItem Method (IMapFactory)
    In This Topic
    Creates a new Map in the project using an item e.g. webmap, mxd etc. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Map CreateMapFromItem( 
       Item item
    )
    Function CreateMapFromItem( _
       ByVal item As Item _
    ) As Map

    Parameters

    item
    An ArcGIS.Desktop.Core.Item

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    You should always check using MapFactory.CanCreateMapFrom() method before passing an item to this method.
    To open a map, use ProApp.Panes.CreateMapPaneAsync method.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also