Google Earth API Samples - Fetch Bad KML

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

Relevant Resources:

Relevant Code Excerpt:

// in this sample we will purposely attempt
// to fetch a bad KML file (one that doesnt exist)

function finished(object) {
  if (!object) {
    // wrap alerts in API callbacks and event handlers
    // in a setTimeout to prevent deadlock in some browsers
    setTimeout(function() {
      alert('Bad or null KML.');
    }, 0);
  }
}

google.earth.fetchKml(ge, 'http://www.google.com/fakePlacemark.kml', finished);