-
Notifications
You must be signed in to change notification settings - Fork 79
/
major-landmarks-india.html
126 lines (114 loc) · 5.86 KB
/
major-landmarks-india.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="description" content="To find the optimal road trip across India.">
<meta name="author" content="Randal S. Olson and Varsha Paidi">
<title>The optimal road trip across India according to machine learning</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
#panel {
position: absolute;
top: 5px;
left: 50%;
margin-left: -180px;
z-index: 5;
background-color: #fff;
padding: 10px;
border: 1px solid #999;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
var directionsDisplay1, directionsDisplay2;
var directionsDisplay3, directionsDisplay4;
var directionsDisplay5, directionsDisplay6;
var markerOptions = {icon: "http://maps.gstatic.com/mapfiles/markers2/marker.png"};
var directionsDisplayOptions = {preserveViewport: true,
markerOptions: markerOptions};
var directionsService = new google.maps.DirectionsService();
var map;
function initialize() {
var center = new google.maps.LatLng(22.5, 78);
var mapOptions = {
zoom: 5 ,
center: center
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
directionsDisplay1.setMap(map);
directionsDisplay2.setMap(map);
directionsDisplay3.setMap(map);
directionsDisplay4.setMap(map);
directionsDisplay5.setMap(map);
directionsDisplay6.setMap(map);
}
function calcRoute(start, end, routes) {
switch (start) {
case "India Backwaters, Kochi, Kerala, India":
directionsDisplay1 = new google.maps.DirectionsRenderer(directionsDisplayOptions);
break;
case "Ganges, Katesar, Varanasi, Uttar Pradesh, India":
directionsDisplay2 = new google.maps.DirectionsRenderer(directionsDisplayOptions);
break;
case "Humayun's Tomb, New Delhi, Delhi, India":
directionsDisplay3 = new google.maps.DirectionsRenderer(directionsDisplayOptions);
break;
case "Palace Of Maharana Pratap, Udaipur, Rajasthan, India":
directionsDisplay4 = new google.maps.DirectionsRenderer(directionsDisplayOptions);
break;
case "India Backwaters, Kochi, Kerala, India":
directionsDisplay4 = new google.maps.DirectionsRenderer(directionsDisplayOptions);
break;
}
var waypts = [];
for (var i = 0; i < routes.length; i++) {
waypts.push({
location:routes[i],
stopover:true});
}
var request = {
origin: start,
destination: end,
waypoints: waypts,
optimizeWaypoints: false,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
switch (start) {
case "India Backwaters, Kochi, Kerala, India":
directionsDisplay1.setDirections(response);
break;
case "Ganges, Katesar, Varanasi, Uttar Pradesh, India":
directionsDisplay2.setDirections(response);
break;
case "Humayun's Tomb, New Delhi, Delhi, India":
directionsDisplay3.setDirections(response);
break;
case "Palace Of Maharana Pratap, Udaipur, Rajasthan, India":
directionsDisplay4.setDirections(response);
break;
case "India Backwaters, Kochi, Kerala, India":
directionsDisplay4.setDirections(response);
break;
}
}
});
}
google.maps.event.addDomListener(window, 'load', initialize);
calcRoute("India Backwaters, Kochi, Kerala, India", "Ganges, Katesar, Varanasi, Uttar Pradesh, India", ["Kodaikanal Lake, Kodaikanal, Tamil Nadu, India", "Marina Beach, Chennai, Tamil Nadu, India", "Virupaksha Temple, Hampi, Karnataka, India", "Golconda Fort, Fort Road, Hyderabad, Telangana, India", "Charminar, Hyderabad, Telangana, India", "Konark Sun Temple, Konark, Odisha, India", "Darjeeling Rangeet Valley Passenger Ropeway, Darjeeling, West Bengal, India", "Kaziranga National Park, Kanchanjuri, Assam, India"]);
calcRoute("Ganges, Katesar, Varanasi, Uttar Pradesh, India", "Humayun's Tomb, New Delhi, Delhi, India", ["Kanha National Park, Madhya Pradesh, India", "Khajuraho Temples, Khajuraho, Madhya Pradesh, India", "Taj Mahal, Agra, Uttar Pradesh, India", "Agra Fort, Agra, Uttar Pradesh, India", "Itmad-ud-Daula, Agra, Uttar Pradesh, India", "Hawa Mahal, Hawa Mahal Road, Badi Choupad, Pink City, Jaipur, Rajasthan, India", "Amer Fort and Palace, Jaipur, Rajasthan, India", "Qutub Minar, New Delhi, Delhi, India"]);
calcRoute("Humayun's Tomb, New Delhi, Delhi, India", "Palace Of Maharana Pratap, Udaipur, Rajasthan, India", ["Swaminarayan Akshardham, New Delhi, Delhi, India", "Gandhi Smriti, New Delhi, Delhi, India", "Red Fort, Netaji Subhash Marg, Chandni Chowk, New Delhi, Delhi, India", "Solang Valley, Burwa, Himachal Pradesh, India", "Dal Lake, Rainawari, Srinagar", "Golden Temple, Amritsar, Punjab, India", "Jaisalmer Fort, Amar Sagar Pol, Jaisalmer, Rajasthan, India", "Mehrangarh Fort, Jodhpur, Rajasthan, India"]);
calcRoute("Palace Of Maharana Pratap, Udaipur, Rajasthan, India", "India Backwaters, Kochi, Kerala, India", ["Sabarmati Ashram, Ahmedabad, Gujarat, India", "Ajanta Caves, Aurangabad, Maharashtra, India", "Gateway Of India Mumbai, Mumbai, Maharashtra, India", "Marine Drive, Chowpatty, Mumbai, Maharashtra, India", "Mani Bhavan Gandhi Sanghralaya, Laburnum Road, Papanas Wadi, Mumbai, Maharashtra, India", "Palolem Beach, Goa, India", "Jog Falls, Karnataka, India", "Maharajah's Palace, Mysore, Karnataka, India"]);
calcRoute("India Backwaters, Kochi, Kerala, India", "India Backwaters, Kochi, Kerala, India", []);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>