-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (69 loc) · 2.12 KB
/
index.html
File metadata and controls
78 lines (69 loc) · 2.12 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Trinity to Downtown Bus Map</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<style>
html, body {
margin: 0;
padding: 0;
font-family: Arial;
font-size: 16px;
}
#map {
width: 100vw;
height: 100vh;
}
#schedule {
position: absolute;
z-index: 999;
top: 10px;
left: 10px;
background: white;
padding: 10px 15px;
}
a, a:hover, a:visited {
color: rgb(58, 132, 223);
text-decoration: none;
margin-left: 5px;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="schedule">
🚌
<a href="https://maps.google.com/maps?ll=41.755394,-72.680268&z=14&t=m&hl=en-US&gl=US&mapclient=embed&saddr=Trinity%20College&daddr=10%20Constitution%20Plaza%2C%20Hartford%2C%20CT%2006103&dirflg=r" target="_blank" >See Bus Schedule</a>
</div>
<script>
function initMap() {
var directionsService = new google.maps.DirectionsService;
var directionsDisplay = new google.maps.DirectionsRenderer;
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 14,
center: {lat: 41.757690, lng: -72.683811}
});
directionsDisplay.setMap(map);
directionsService.route({
origin: 'Trinity College, Hartford, CT',
destination: '10 Constitution Plaza, Hartford, CT',
travelMode: 'TRANSIT'
}, function(response, status) {
if (status === 'OK') {
directionsDisplay.setDirections(response);
} else {
window.alert('Directions request failed due to ' + status);
}
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDYB7YXly3VfIn1qiaq5F4Gn2FdCMEZPFc&callback=initMap">
</script>
</body>
</html>