Google Maps API Tutorial - GGeoXml

© 2007 Mike Williams

 

GgeoXml

The GGeoXml() feature creates an overlay from a KML file.

You use it like this:

   var kml = new GGeoXml("http://mydomain.com/myfile.kml");
   map.addOverlay(kml)
Here's an example

The previous technique of using the mapsdt server to render polygons and polylines from KML files is now obsolete. The new GGeoXml method is more powerful, easier to use, and is clearly witing the Terms of Use.

Potential Pitfalls

  1. The KML file must be accessible by the Google KML rendering server. It won't work with KML files on your local computer. You don't get any error messages if the KML file is inaccessible.

  2. GGeoXml overlays don't support .hide() and .show() methods. To hide and show them, use map.removeOverlay() and map.addOverlay().
Back to Mike's Homepage
Up to the start of this tutorial