ArcGIS Pro 2.7 API Reference Guide
CreateMapFromItem Method (MapFactory)
Example 

ArcGIS.Desktop.Mapping Namespace > MapFactory Class : CreateMapFromItem Method
An ArcGIS.Desktop.Core.Item
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
public Map CreateMapFromItem( 
   Item item
)
Public 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.
Example
Open a webmap.
Map map = null;

//Assume we get the selected webmap from the Project pane's Portal tab
if (Project.Current.SelectedItems.Count > 0)
{
  if (MapFactory.Instance.CanCreateMapFrom(Project.Current.SelectedItems[0]))
  {
    map = MapFactory.Instance.CreateMapFromItem(Project.Current.SelectedItems[0]);
    await ProApp.Panes.CreateMapPaneAsync(map);
  }
}
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapFactory Class
MapFactory Members