Search code examples
htmlkmlgoogle-earthgoogle-earth-plugin

how to toggle between KML files in Google Earth or toggle between sets of points


so basically I have a KML file that I load up, and I have 2 different sets of points that I present on there. However, I want to be able to present one set at a time, I figured the simplest way to do this is to split the set into 2 different KML files, and then load the appropriate file depending on set, or if there is another way of doing this, it could work for me as well. Thanks a lot.


Solution

  • While kaliatech's answer is correct and useful, it is also a bit of overkill and harder to implement than this approach. It is a Google example and toggles the loading of various KML files via checkboxes.

    All you need to do is change the filenames of your kmls to red/yellow/green OR change to code to names more specific to your use - depending on how comfortable you feel and what ythe end result you want is.