Google Earth API Samples - Showing Time UI by Parsing Time-aware KML

Last Modified:
06/08/2009
Installed Plugin Version:
...

Relevant Resources:

Relevant Code Excerpt:

// Sample KML taken from 
//   http://code.google.com/apis/kml/documentation/kml_tut.html#polygons
var timeAwareDoc = ge.parseKml(
  '<?xml version="1.0" encoding="UTF-8"?>' +
  '<kml xmlns="http://www.opengis.net/kml/2.2">' +
  '  <Document>' +
  '    <Placemark>' +
  '      <name>Placemark 1</name>' +
  '      <TimeSpan>' +
  '        <begin>2007-01-14T21:05:02Z</begin>' +
  '        <end>2007-01-14T21:05:20Z</end>' +
  '      </TimeSpan>' +
  '      <Point>' +
  '        <coordinates>-122.536226,37.86047,0</coordinates>' +
  '      </Point>' +
  '    </Placemark>' +
  '    <Placemark>' +
  '      <name>Placemark 2</name>' +
  '      <TimeSpan>' +
  '        <begin>2007-01-14T21:05:20Z</begin>' +
  '        <end>2007-01-14T21:05:43Z</end>' +
  '      </TimeSpan>' +
  '      <Point>' +
  '        <coordinates>-122.536422,37.860303,0</coordinates>' +
  '      </Point>' +
  '    </Placemark>' +
  '    <Placemark>' +
  '      <name>Placemark 3</name>' +
  '      <TimeSpan>' +
  '        <begin>2007-01-14T21:05:43Z</begin>' +
  '        <end>2007-01-14T21:06:04Z</end>' +
  '      </TimeSpan>' +
  '      <Point>' +
  '        <coordinates>-122.536688,37.860072,0</coordinates>' +
  '      </Point>' +
  '    </Placemark>' +
  '  </Document>' +
  '</kml>');

ge.getFeatures().appendChild(timeAwareDoc);

// Fly to the Pentagon
var la = ge.createLookAt('');
la.set(37.860303, -122.536422, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 45, 75);
ge.getView().setAbstractView(la);