-
Notifications
You must be signed in to change notification settings - Fork 1
/
results.html
59 lines (54 loc) · 1.7 KB
/
results.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Daily Walk Bot Results</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var date = location.search.split('date=')[1] ? location.search.split('date=')[1] : '';
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", "http://jlareau.club.cc.cmu.edu/walker/data" + date + ".txt", false );
xmlHttp.send( null );
encodedPath = xmlHttp.responseText;
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: google.maps.geometry.encoding.decodePath(encodedPath)[0]
});
var lineSymbol = {
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW
};
var walkPath = new google.maps.Polyline({
path: google.maps.geometry.encoding.decodePath(encodedPath),
geodesic: true,
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
icons: [{
icon: lineSymbol,
repeat: '2%'
}],
});
walkPath.setMap(map);
}
</script>
<!-- The API key here is limited to use on the domain jlareau.club.cc.mu.edu
You will have to replace it with your own if you want to use this page. -->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDJAUwP5BmrJFVolo9T7OQsf_CusoHODIo&libraries=geometry&callback=initMap">
</script>
</body>
</html>