ArcObjects Library Reference (Carto)  

IMap.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, ArcGIS Desktop, and ArcGIS Server.

Remarks

ClearLayers removes all layers types from the Map.  ClearLayers does not change or reset the Map's spatail reference however.  In addition, ClearLayers does not affect any graphics stored in the Map's BasicGaphicsLayer - it's not a true Layer.  ClearLayers does not update the contents view (TOC) or the display.

See Also

IMap Interface