Select to view content in your preferred language

Removing KML layers

2170
2
Jump to solution
03-29-2012 12:56 PM
WilliamHenson
Occasional Contributor
Hi,

I can easily add KML layers either at startup or through a radio button/check box, but does anyone have any pointers on how to remove/delete/hide said KML layer when you are finished with it??  I have looked at the sample code and do not gat the same options for removing non KML layers

Cheers
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
how to remove/delete/hide said KML layer when you are finished with it??


Kml layer should behave as others layers.
You can hide a kml layer by changing its visibility : kmlLayer.Visible = false;
You can remove a kml layer by removing it from the map layers collection : myMap.Layers.Remove[kmlLayer];

Is there a KML specific issue you run into?

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
how to remove/delete/hide said KML layer when you are finished with it??


Kml layer should behave as others layers.
You can hide a kml layer by changing its visibility : kmlLayer.Visible = false;
You can remove a kml layer by removing it from the map layers collection : myMap.Layers.Remove[kmlLayer];

Is there a KML specific issue you run into?
0 Kudos
WilliamHenson
Occasional Contributor
Ah!  That's the command, could find the add layer but wasnt sure if it was remove or delete or hide or............

Also had an issue ID'ing the layer but figured that out in short time after I got the command

Cheers
0 Kudos