Search code examples
kmlgoogle-earth

KML change visibility of a folder with AnimatedUpdate in Google Earth


In KML it's possible to change the visibility during a Tour with the AnimatedUpdate element for a single Placemark as shown below:

  <gx:AnimatedUpdate>
    <gx:duration>0.0</gx:duration>
    <Update>
      <targetHref/>
      <Change>
        <Placemark targetId="pin2">
          <gx:balloonVisibility>1</gx:balloonVisibility>
        </Placemark>
      </Change>
    </Update>
  </gx:AnimatedUpdate>

How can I change the visibility of a complete folder? Alternatively, how can I change the visibility of a set of Placemarks with a "compact" AnimatedUpdate element? If possible, I'd like to avoid listing every single Placemark in the AnimatedUpdate element.


Solution

  • It turns out it's as simple as the following snippet:

    <gx:AnimatedUpdate>
    <gx:duration>0.0</gx:duration>
    <Update>
      <targetHref/>
      <Change>
        <Placemark targetId="folder_id">
          <visibility>1</visibility>
        </Placemark>
      </Change>
    </Update>
    </gx:AnimatedUpdate>
    

    The only problem: it looks like Google Earth Desktop (for Windows) has a bug that each Folder/Placemark visibility must be set to 1 in the KML file. Otherwise it's not possible to change the visibility during the tour.