ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / LayerTemplatePackages Property
Example

In This Topic
    LayerTemplatePackages Property
    In This Topic
    Gets the collection of layer template packages installed with Pro for use with maps
    Syntax
    Public ReadOnly Property LayerTemplatePackages As IReadOnlyList(Of Item)
    public IReadOnlyList<Item> LayerTemplatePackages {get;}
    Remarks
    Currently, these include the set of packages defined for Map Notes. To add one of the templates to the map use LayerFactory.CreateLayer<T>. Use the LayerCreationParams overload: LayerCreationParams.LayerCreationParams Constructor(Item)
    Example
    Add MapNotes to the active map
    {
        //Gets the collection of layer template packages installed with Pro for use with maps
        var items = MapView.Active.Map.LayerTemplatePackages;
        //Iterate through the collection of items to add each Map Note to the active map
        foreach (var item in items)
        {
            //Create a parameter item for the map note
            var layer_params = new LayerCreationParams(item);
            layer_params.IsVisible = false;
            //Note: Needs QueuedTask to run
            //Create a feature layer for the map note
            var layerCreated = LayerFactory.Instance.CreateLayer<Layer>(layer_params, MapView.Active.Map);
        }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also