<html>
<head>
<script src="https://maps.googleapis.com/maps/api/js?key=ENTER_YOUR_OWN_GOOGLE_MAPS_API_KEY_HERE&sensor=false">
</script>
<script type="text/JavaScript">
function doUpdate(marker, map) {
var xmlhttp;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "/location.current", false);
xmlhttp.send();
var myLat = /^[^,]*/.exec(xmlhttp.response);
var myLng = /[^,]*$/.exec(xmlhttp.response);
console.log("printout!" + myLat + ":" + myLng);
marker.setPosition( new google.maps.LatLng( myLat, myLng ));
marker.setMap(map);
}
function initialize()
{
var mapProp = {
center:new google.maps.LatLng(59.363995,18.057404),
zoom:11,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap") ,mapProp);
var marker=new google.maps.Marker({ position: new google.maps.LatLng(59.363995,18.057404), title:"me" });
marker.setMap(map);
setInterval(function(){doUpdate(marker, map)}, 5000);
}
google.maps.event.addDomListener(window, \'load\', initialize);
</script>
</head>
<body>
<div id="googleMap" style="height: 600px; width: 1200px;">
</div>
</body>
</html>