Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to create a button using VB.NET and ArcGIS 10 to clear the layers of my data frame.

I know how to add layers, but I don't have any idea on how to delete/clear them.

Any suggestions?

Thank you!

share|improve this question
add comment

1 Answer 1

The easiest way is to cast the Map to IMapLayers and call the IMapLayers.ClearLayers method.

share|improve this answer
    
Thank you... but I don't understand because I new doing this.. .... –  TitoGIS Dec 12 '12 at 11:06
    
How can I call IMapLayers.ClearLayers? Thank you –  TitoGIS Dec 12 '12 at 11:12
    
Perhaps at this point it would help you to start with some high-level ArcObjects documentation on your own. The overview for esriCarto library contains lots of information that will be beneficial in your case. –  Petr Krebs Dec 12 '12 at 13:18
    
Also the Working with the map article could help you. –  Petr Krebs Dec 12 '12 at 13:20
1  
Great, you can learn a lot by browsing the documentation. Note you can also call DirectCast(Map, IMapLayers).ClearLayers() in VB.NET, where Map is an IMap variable. C# equivalent is ((IMapLayers)Map).ClearLayers();. –  Petr Krebs Dec 12 '12 at 19:41
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.