ArcGIS Pro 2.7 API Reference Guide
ConvertMap Method (MapFactory)

ArcGIS.Desktop.Mapping Namespace > MapFactory Class : ConvertMap Method
The map to convert
The type to convert the map to
true to open a map pane for the newly converted map
Convert the input map to the specified output type. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Public Function ConvertMap( _
   ByVal map As Map, _
   ByVal convertTo As MapConversionType, _
   ByVal openView As Boolean _
) As Map

Parameters

map
The map to convert
convertTo
The type to convert the map to
openView
true to open a map pane for the newly converted map

Return Value

The converted Map
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Cannot convert {map} to {conversion type}
Failed to convert the map viewing mode
Remarks
The following conversions are supported: o Map -> Base map, Scene (Global), Scene (Local)
o BaseMap -> Map
o Scene (Global) -> Map
o Scene (Local) -> Map
Technically, there is no difference between the Scene (Global) or Scene (Local). It merely indicates the nature or their underlying coordinate system (i.e. "global" or "local").
The intended conversion can be tested by calling the CanConvertMap method first.
Specifying openView=true will open a new view for the converted map. The method will return without waiting for the view to initialize and begin drawing. This is an optimization to prevent Pro being loaded down with viewer initialization if this method is called within a loop to create multiple maps. The correct way to detect viewer initialization is via the ArcGIS.Desktop.Mapping.Events.ActiveMapViewChangedEvent. The event will fire after the first draw of the new view has been initiated.
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapFactory Class
MapFactory Members