2

I can clear all the layers using mapControl.ClearLayers(), but I only want to clear one layer (a sublayer of a basemap, like cities). I'm new at this, thanks in advance.

edit: i am using C#

patrick
  • 16,091
  • 29
  • 100
  • 164

1 Answers1

1

I'm unsure of which API you are using, but I know C# well. When you add layers you usually attach a name to the property. You can either choose it by the name, or the index.

mapControl.Layers[1].Clear();
mapControl.Layers["My Layer"].Clear();
jsmith
  • 7,198
  • 6
  • 42
  • 59