This document is archived and information here might be outdated.  Recommended version.

IMapLayers.InsertLayers Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IM > IMapLayers Interface > IMapLayers.InsertLayers Method
ArcGIS Developer Help

IMapLayers.InsertLayers Method

Inserts layers at the given position.

[Visual Basic .NET]
Public Sub InsertLayers ( _
    ByVal pLayers As IEnumLayer, _
    ByVal autoArrange As Boolean, _
    ByVal position As Integer _
public void InsertLayers (
    IEnumLayer pLayers,
    bool autoArrange,
    int position
HRESULT InsertLayers(
  IEnumLayer* pLayers,
  VARIANT_BOOL autoArrange,
  long position
pLayers [in]

pLayers is a parameter of type IEnumLayer* autoArrange [in]
autoArrange is a parameter of type bool position [in]
position is a parameter of type long

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


The autoArrange parameter controls the ordering of the layers.  If autoArrange is set to TRUE, the layers are added in the proper position as by their weight specified via ILayerPosition::LayerWeight.  By default, this means that the layers are sorted by layer type - Annotation layers on top, followed by Point geometry layers, Polyline geometry layers, and at the bottom Polygon geometry layers.  If autoArrange is true for this method, the position passed in is ignored as the position is determined by the auto arrange logic.

See Also

IMapLayers Interface