ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IMapFactory Interface / CreateMapFromJson Method
JSON string containing the map definition.

In This Topic
    CreateMapFromJson Method (IMapFactory)
    In This Topic
    Creates a new Map in the project. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Map CreateMapFromJson( 
       string json
    )
    Function CreateMapFromJson( _
       ByVal json As String _
    ) As Map

    Parameters

    json
    JSON string containing the map definition.

    Return Value

    A map.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    JSON string can't be empty.
    Cannot create map with provided JSON string.
    Remarks
    Use this method with a JSON string representing the contents of a mapX file (see Map.SaveAsFile. A web map JSON string such as that created via Map.SaveAsWebMapFile is not valid and will throw an ArgumentException.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also