ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ILayerFactory Interface / CreateLayer Method / CreateLayer<T>(LayerCreationParams,ILayerContainerEdit) Method
Expected Layer Type
Can be one of LayerCreationParams derived objects.
A map or group layer instance to which the Layer will be added.

In This Topic
    CreateLayer<T>(LayerCreationParams,ILayerContainerEdit) Method
    In This Topic
    Creates a new Layer instance using the specified LayerCreationParams and adds that to a container such as a map or group layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Overloads Function CreateLayer(Of T As Layer)( _
       ByVal layerParams As LayerCreationParams, _
       ByVal container As ILayerContainerEdit _
    ) As T

    Parameters

    layerParams
    Can be one of LayerCreationParams derived objects.
    container
    A map or group layer instance to which the Layer will be added.

    Type Parameters

    T
    Expected Layer Type

    Return Value

    A specific Layer instance corresponding to type T.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also