theMechanism | Google Maps API Demo | KML

Adding KML overlays to a Google map:

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.

Some methods of the GGeoXML object

Resources

Last update—22 February 2008

neogeography index