forked from Landeronini/ChecaCDMX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checa.html
57 lines (52 loc) · 1.47 KB
/
checa.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
<!DOCTYPE html>
<html>
<head>
<title>Checa CDMX
</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 500px;
width: 500px;
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var chicago = {lat: 41.85, lng: -87.65};
var indianapolis = {lat: 39.79, lng: -86.14};
var map = new google.maps.Map(document.getElementById('map'), {
center: chicago,
scrollwheel: false,
zoom: 7
});
var directionsDisplay = new google.maps.DirectionsRenderer({
map: map
});
// Set destination, origin and travel mode.
var request = {
destination: indianapolis,
origin: chicago,
travelMode: google.maps.TravelMode.DRIVING
};
// Pass the directions request to the directions service.
var directionsService = new google.maps.DirectionsService();
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
// Display the route on the map.
directionsDisplay.setDirections(response);
}
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAUIOAcd8tHlCNzutnDuiiDFMbilqHc2dQ&signed_in=true&libraries=drawing&callback=initMap"
async defer></script>
</body>
</html>