// === Define the function to process the sundial trails file === function processTrailFile(doc) { var xmlDoc = GXml.parse(doc); // ========= Now process the polylines =========== var lines = xmlDoc.documentElement.getElementsByTagName("line"); // read each line for (var a = 0; a < lines.length; a++) { // get any line attributes var colour = lines[a].getAttribute("colour"); var width = parseFloat(lines[a].getAttribute("width")); // read each point on that line var points = lines[a].getElementsByTagName("point"); var pts = []; for (var i = 0; i < points.length; i++) { pts[i] = new GLatLng(parseFloat(points[i].getAttribute("lat")), parseFloat(points[i].getAttribute("lon"))); } map.addOverlay(new GPolyline(pts,colour,width)); } // ================================================ } //end function