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




fromIndex
Index of layer to be moved.
toIndex
The new index of the layer.
Moves a layer to a new location in the collection.

Syntax

Visual Basic (Declaration) 
Public Sub MoveTo( _
   ByVal fromIndex As Integer, _
   ByVal toIndex As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As LayerCollection
Dim fromIndex As Integer
Dim toIndex As Integer
 
instance.MoveTo(fromIndex, toIndex)
C# 
public void MoveTo( 
   int fromIndex,
   int toIndex
)

Parameters

fromIndex
Index of layer to be moved.
toIndex
The new index of the layer.

Example

The following example moves the bottom-drawn layer in the map up one position in the layer collection.
C#Copy Code
// Get the layer collection from a MapView 

ESRI.ArcGIS.ADF.IMS.Carto.Layer.LayerCollection mapLayers; 

mapLayers = mapView.Layers; 

  

// Move bottom layer up one position 

mapLayers.MoveTo(0, 1); 

    
Visual BasicCopy Code
' Get the layer collection from a MapView

Dim mapLayers As ESRI.ArcGIS.ADF.IMS.Carto.Layer.LayerCollection

mapLayers = mapView.Layers



' Move bottom layer up one position

mapLayers.MoveTo(0, 1)

Remarks

This method alters the position of a layer within the map's layers collection, which modifies the drawing order of layers. Note that the layers collection is 0-based.

See Also

© 2010 All Rights Reserved.