![]() ![]() |
ESRI.ArcGIS.ADF.IMS | |
Remove Method | |
See Also Example Send Feedback |
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace > LayerCollection Class : Remove Method |
- layer
- The layer to remove.
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As LayerCollection Dim layer As Layer instance.Remove(layer) |
Parameters
- layer
- The layer to remove.
The following example removes a layer from the map's layer collection using a reference to the layer. The code assumes an existing MapView object.
C# | ![]() |
---|---|
// Get the layer collection from a MapView ESRI.ArcGIS.ADF.IMS.Carto.Layer.LayerCollection mapLayers mapLayers = mapView.Layers; // Get a reference to the layer to remove ESRI.ArcGIS.ADF.IMS.Carto.Layer.Layer layerX = mapLayers.FindByName("Countries"); // Remove the first (bottom) layer from the map mapLayers.Remove(layerX); |
Visual Basic | ![]() |
---|---|
' Get the layer collection from a MapView Dim mapLayers As ESRI.ArcGIS.ADF.IMS.Carto.Layer.LayerCollection mapLayers = mapView.Layers ' Get a reference To the layer To remove Dim layerX As ESRI.ArcGIS.ADF.IMS.Carto.Layer.Layer = mapLayers.FindByName("Countries") ' Remove the first (bottom) layer from the map mapLayers.Remove(layerX) |
This method removes a layer completely from the layer collection of the MapView orDataFrame. Both dynamic and static layers may be removed. After removal, the layer is not recoverable in the current MapView, unless a reference is maintained to the deleted layer and it is re-added (or unless a new MapView is generated from the MapService).
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family