Adding a KML overlay to your map is two lines of code:
var kml = new GGeoXml('http://themechanism.com/demo/gmaps/demos/data/aStroll.kml');
this._map.addOverlay(kml);
The GGeoXml object takes two parameters: a required URL of a publicly accessible XML file in either KML or GeoRSS format and an optional callback function invoked when the XML file specified in the first parameter is finished loading.
In my demo, I created a new GGeoXml object and stored it in a variable named kml.
Last update—22 February 2008