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


IMapControl2.ClearLayers Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IM > IMapControl2 Interface > IMapControl2.ClearLayers Method
ArcGIS Developer Help

IMapControl2.ClearLayers Method

Removes all layers from the Map.

[Visual Basic .NET]
Public Sub ClearLayers ( _
)
[C#]
public void ClearLayers (
);
[C++]
HRESULT ClearLayers(
void
);

Product Availability

Available with ArcGIS Engine.

Description

The method is a shortcut to IMap::ClearLayers and removes all layers from the Map. ClearLayers does not change or reset the map's SpatialReference

See Also

IMapControl2 Interface | IMapControl4.DeleteLayer Method | IMapControl2.DeleteLayer Method | IMapControl3.DeleteLayer Method | IMapControl4.Layer Property | IMapControl3.Layer Property | IMapControl2.Layer Property | IMapControl4.LayerCount Property | IMapControl3.LayerCount Property | IMapControl2.LayerCount Property | IMapControl2.MoveLayerTo Method | IMapControl4.MoveLayerTo Method | IMapControl3.MoveLayerTo Method