ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / GraphicsLayerCreationParams Class
Members Example

In This Topic
    GraphicsLayerCreationParams Class
    In This Topic
    Represents an object to initialize and create a graphics layer.
    Object Model
    GraphicsLayerCreationParams ClassLayer ClassLayer ClassLayer ClassLayer ClassLayer ClassCIMDataConnection ClassItem ClassCIMLayerDocument Class
    Syntax
    Public Class GraphicsLayerCreationParams 
       Inherits LayerCreationParams
    public class GraphicsLayerCreationParams : LayerCreationParams 
    Example
    Create GraphicsLayer
    {
      if (map.MapType != MapType.Map)
        return;// not 2D
    
      var gl_param = new GraphicsLayerCreationParams { Name = "Graphics Layer" };
      // Note: must be called on the QueuedTask
      {
        //By default will be added to the top of the TOC
        graphicsLayer = LayerFactory.Instance.CreateLayer<ArcGIS.Desktop.Mapping.GraphicsLayer>(gl_param, map);
    
        //Add to the bottom of the TOC
        gl_param.MapMemberIndex = -1; //bottom
        LayerFactory.Instance.CreateLayer<ArcGIS.Desktop.Mapping.GraphicsLayer>(gl_param, map);
    
        //Add a graphics layer to a group layer...
        var group_layer = map.GetLayersAsFlattenedList().OfType<GroupLayer>().First();
        LayerFactory.Instance.CreateLayer<ArcGIS.Desktop.Mapping.GraphicsLayer>(gl_param, group_layer);
    
        //TODO...use the graphics layer
        //
    
        // or use the specific CreateGroupLayer method
        LayerFactory.Instance.CreateGroupLayer(map, -1, "Graphics Layer");
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.BaseCreationParams
          ArcGIS.Desktop.Mapping.MapMemberCreationParams
             ArcGIS.Desktop.Mapping.LayerCreationParams
                ArcGIS.Desktop.Mapping.GraphicsLayerCreationParams

    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also