ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapFactory Class / CanConvertMap Method
The map to test
The type to convert the map to
Example

In This Topic
    CanConvertMap Method (MapFactory)
    In This Topic
    Determines whether the map can be converted to the specified output type. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool CanConvertMap( 
       Map map,
       MapConversionType convertTo
    )
    Public Function CanConvertMap( _
       ByVal map As Map, _
       ByVal convertTo As MapConversionType _
    ) As Boolean

    Parameters

    map
    The map to test
    convertTo
    The type to convert the map to

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    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
    Specifying an invalid conversion type will return false
    Note: If MapConversionType.SceneGlobal is specified, if the map spatial reference contains a vertical coordinate system, the VCS is checked to see if it is compatible with a global scene. If it is not, the method will also return false
    Example
    Convert Map to Local Scene
    //Note: Run within the context of QueuedTask.Run
    bool canConvertMap = MapFactory.Instance.CanConvertMap(map, MapConversionType.SceneLocal);
    if (canConvertMap)
      MapFactory.Instance.ConvertMap(map, MapConversionType.SceneLocal, true);
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also