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


IMapLayers.AddLayers 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.AddLayers Method
ArcGIS Developer Help

IMapLayers.AddLayers Method

Adds multiple layers to the map, arranging them nicely if specified.

[Visual Basic .NET]
Public Sub AddLayers ( _
    ByVal Layers As IEnumLayer, _
    ByVal autoArrange As Boolean _
)
[C#]
public void AddLayers (
    IEnumLayer Layers,
    bool autoArrange
);
[C++]
HRESULT AddLayers(
  IEnumLayer* Layers,
  VARIANT_BOOL autoArrange
);
[C++]
Parameters
Layers [in]

Layers is a parameter of type IEnumLayer* autoArrange [in]
autoArrange is a parameter of type bool

Product Availability

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

Description

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.

Remarks

The autoArrange parameter controls the ordering of the layers.  If autoArrange is set to TRUE, the sequence of layers is 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.

See Also

IMapLayers Interface