/* Example use of the PolylineEncoder class.
function load() {
  if (GBrowserIsCompatible()) {
	// Make sure that SVG is on.
	if(document.implementation.hasFeature(
		"http://www.w3.org/TR/SVG11/feature#SVG","1.1")){ 
	  _mSvgEnabled = true;
	  _mSvgForced  = true;
	}
	// Set up the map.
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.addControl(new GScaleControl());
	map.setCenter(new GLatLng(35.114515, -82.7151955), 11);
	
	// Prepare for encoding!
	var polylineEncoder = new PolylineEncoder();
	
	// Read the XML file (which is actually GPX).
	// Pack the trkpts into a path to encode.
	// This is done asyncronously via the API's GXmlHttp namespace.
	// The technique is described on Mike William's tutorial page:
	// http://www.econym.demon.co.uk/googlemaps/basic7.htm,
	// Although he generates a regular GPolyline.
	var request = GXmlHttp.create();
	request.open("GET", "AOTC.xml", true);
	request.onreadystatechange = function() {
		if(request.readyState == 4) {
			var xmlDoc = request.responseXML;
			var trks = xmlDoc.documentElement.getElementsByTagName("trk");
			for (i = 0; i<trks.length; i++) {
				var trkPoints = trks[i].getElementsByTagName("trkpt");
				var points = new Array(0);
				for (j = 0; j<trkPoints.length; j++) {
					points[j] = new GLatLng(parseFloat(trkPoints[j].getAttribute("lat")),
						parseFloat(trkPoints[j].getAttribute("lon")));
				}
				// Encode!
				polyline = polylineEncoder.dpEncodeToGPolyline(points);
				map.addOverlay(polyline);
			}
		}
	}
	request.send(null);
   }
}
*/