Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (55 sloc) 2.08 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xmlns:v="urn:schemas-microsoft-com:vml">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps GPX Test - async</title>
<style type="text/css">
v\:* {
<!-- Make the document body take up the full screen -->
<style type="text/css">
html, body {width: 100%; height: 100%}
body {margin-top: 0px; margin-right: 0px; margin-left: 0px; margin-bottom: 0px}
<!-- Replace the key in the line below with an API key for your site. You can get one here -->
<script src="//[YOUR KEY HERE]" type="text/javascript"></script>
<script src="../../loadgpx.js" type="text/javascript"></script>
<script type="text/javascript">
var MyMap;
function LoadGPXFileIntoGoogleMap(map, filename)
var request = new XMLHttpRequest();"GET", filename, true);
request.onreadystatechange = function()
if (request.readyState == 4)
parser = new GPXParser(request.responseXML, map);
parser.SetTrackColour("#ff0000"); // Set the track line colour
parser.SetTrackWidth(5); // Set the track line width
parser.SetMinTrackPointDelta(0.001); // Set the minimum distance between track points
parser.CenterAndZoom(request.responseXML); // Center and Zoom the map over all the points.
parser.AddTrackpointsToMap(); // Add the trackpoints
parser.AddWaypointsToMap(); // Add the waypoints
function onLoad()
MyMap = new google.maps.Map(document.getElementById("map"), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
LoadGPXFileIntoGoogleMap(MyMap, "pocotrail.xml");
<body onload="onLoad()">
<div id="map" style="width: 100%; height: 100%;"></div>