-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNodos1.html
41 lines (41 loc) · 1.49 KB
/
Nodos1.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
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body { height: 100%; margin: 0; padding: 0; }
#map { height: 40%; width:40%; }
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript" src="js/Estados.js"></script>
<script type="text/javascript">
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: Estados[5].center,
zoom: 10
});
var directionsRender=new google.maps.DirectionsRenderer({
map:map
});
var camino={
destination:Estados[5].center,
origin:Estados[3].center,
travelMode: 'DRIVING',
waypoints:[{
location:Estados[1].center,
stopover:true
}]
};
var directionService=new google.maps.DirectionsService();
directionService.route(camino,function(response,status){
if(status=='OK'){
directionsRender.setDirections(response);
}
});
}
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA492l51r5sWbbTWH36xzu8gW2G1SfcKcA&callback=initMap"></script>
</body>
</html>