ESRI.ArcGIS.ADF.IMS
Insert Method
See Also 
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > LayerCollection Class : Insert Method




index
Index at which to insert the layer into the collection.
layer
The layer to insert into the collection.
Inserts a layer into the collection at a given index.

Syntax

Visual Basic (Declaration) 
Public Sub Insert( _
   ByVal index As Integer, _
   ByVal layer As Layer _
) 
Visual Basic (Usage)Copy Code
Dim instance As LayerCollection
Dim index As Integer
Dim layer As Layer
 
instance.Insert(index, layer)
C# 
public void Insert( 
   int index,
   Layer layer
)

Parameters

index
Index at which to insert the layer into the collection.
layer
The layer to insert into the collection.

Example

For an example of using the Insert method, see ImageLayer(string,ImageDataset).

Remarks

The Insert method enables adding a layer to the map's LayerCollection at a specific placement in the layer order. Since layers draw in their order in the LayerCollection, this allows specific order of drawing for layers. The first (0) layer draws at the bottom, and higher-number layers draw above.

A typical use of this method would be when adding image and polygon layers to the map, and you do not want these layers to obscure point and line layers. , as they would typically be when using Add.

The layer is inserted at the index parameter, and the layer currently at that index is moved one integer value higher.

See Also

© 2010 All Rights Reserved.