This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multimodal.html
164 lines (149 loc) · 7.2 KB
/
multimodal.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html data-ng-app="routing">
<head>
<meta charset="utf-8" />
<title>Leaflet Routing Machine - Vahalla </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
<link rel="stylesheet" href="css/leaflet-routing-machine.css" />
<link rel="stylesheet" href="css/valhalla.css" />
<link rel="stylesheet" href="css/elevation.css" />
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.standalone.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.4.1/leaflet-geocoder-mapzen.css" >
<script src="conf/env.conf"></script>
<!-- Main tangram library -->
<script src="https://mapzen.com/tangram/tangram.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script language="javascript" type="text/javascript" src="js/calendar/datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
<script type = "text/javascript" src="../flot/jquery.flot.min.js"></script>
<script type = "text/javascript" src="../flot/jquery.flot.symbol.min.js"></script>
<script type="text/javascript" src="../flot/jquery.flot.js"></script>
<script type="text/javascript" src="../flot/jquery.colorhelpers.js"></script>
<script type="text/javascript" src="../flot/jquery.flot.canvas.js"></script>
<script type="text/javascript" src="../flot/jquery.flot.stack.js"></script>
<style>
body{
width: 100%;
height: 100%;
}
#mapwrapper{
padding:0;
}
.transparent_btn{
height:30px;
margin-bottom:10px;
}
.transparent_btn:hover{
background-color:#ccc;
}
/* .info {
display: inline-block;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}*/
</style>
</head>
<body>
<div class="container-fluid" data-ng-controller="RouteController">
<div class="col-md-2 info">
<div id="instructions">
<img src="images/turnbyturnlogo.png" alt="logo">
<p><h6><b>Point & click on the map to select a start & end point.</b>
<b>Transit only demo.</b><br></h6></p>
<h5><b><a target="_blank" href='https://github.com/valhalla/valhalla-docs/blob/master/api-reference.md'>Turn-by-Turn API reference</a></b></h5>
<hr>
<div>
<br>
<span style="color:black" class="descriptions">Select a locale:</span><br>
<select id = "locale_dropdown" onchange="selectLocale()">
<option id=en-US selected="selected" value="en-US">en-US</option>
<option id=de-DE value="de-DE">de-DE</option>
<option id=it-IT value="it-IT">it-IT</option>
<option id=cs-CZ value="cs-CZ">cs-CZ</option>
<option id=fr-FR value="fr-FR">fr-FR</option>
<option id=es-ES value="es-ES">es-ES</option>
<option id=hi-IN value="hi-IN">hi-IN</option>
<option id=ca-ES value="ca-ES">ca-ES</option>
<option id=sl-SI value="sl-SI">sl-SI</option>
<option id=ru-RU value="ru-RU">ru-RU</option>
<option id=pirate value="pirate">pirate</option>
</select>
<br><br>
<span style="color:black" class="descriptions">Multimodal Options:</span><br>
<form>
<input type="button" id="showbtn" name="showbtn" value="Show"/>
<input type="button" id="hidebtn" name="hidebtn" value="Hide"/>
</form>
</div>
<div id="transitoptions" name="transitoptions" style="display:none">
<form id="transit" name="transit" ><span style="color:black">
<h5><b>Transit Options:</b></h5><p>
use_bus (0-1): <input type="textbox" id="use_bus" value="0.3" class="transittextbox"/><br>
use_rail (0-1): <input type="textbox" id="use_rail" value="0.6" class="transittextbox"/><br>
use_transfers (0-1): <input type="textbox" id="use_transfers" value="0.3" class="transittextbox"/>
</span>
</form>
<hr>
</div>
<div id="dtoptions" name="dtoptions" style="display:none">
<form id="datetime" name="datetime" ><span style="color:black">
<h5><b>Date & Time Options:</b></h5><p>
Current: <input type="radio" name="dttype" value="0" checked/>
Depart: <input type="radio" name="dttype" value="1"/>
Arrive: <input type="radio" name="dttype" value="2"/>
<br><p>
<span style="color:black" class="descriptions"><b>Select a new date and/or time, then click a mode of travel.</b></span><br>
<input type="text" id="datepicker" size="25"><a href="javascript:NewCal('datepicker','ddmmmyyyy',true,24)"><img src="resource/cal.gif" width="20" height="20" border="0" alt="Pick a date & time"></a><br>
</form>
</div>
<br>
<button id="multi_btn" class = "transparent_btn" type="button">Transit</button>
</div>
<div id='permalink' style='display:inline-block;'></div><br>
<!-- <div id="routeResponse" style="display:inline-block;">JSON Response Link</div> -->
<div id="route_inst" ng-bind-html="renderHtml(route_instructions)"></div>
<div>
<button class="reset" ng-click="clearAll()"> clear all </button>
</div>
</div>
<div id="mapwrapper" class="col-md-10">
<div id="map"></div>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
<script type="text/javascript" src="js/leaflet-hash.js"></script>
<script src="js/valhalla.js"></script>
<script src='dist/leaflet-routing-machine.js'></script>
<script src='dist/lrm-mapzen-patched.js'></script>
<script src="js/elevation/L.Elevation.js"></script>
<script src="js/locate/L.Locate.js"></script>
<script src="https://mapzen.com/js/mapzen.standalone.js"></script>
<!-- Load geocoding plugin after Leaflet -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-geocoder-mapzen/1.4.1/leaflet-geocoder-mapzen.js"></script>
<script>
var defaultMode = 'multimodal';
var road = L.tileLayer('https://b.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution : '© <a href="https://openstreetmap.org">OpenStreetMap</a> contributers'
});
var mapzen = {
scene: {
import: L.Mapzen.BasemapStyles.RefillMoreLabels,
global: {
sdk_transit_overlay: true
}
}
};
</script>
<!-- Adding a script block to post message to the parent container (think iframed demos) -->
<script type="text/javascript">
window.addEventListener("hashchange",function(){parent.postMessage(window.location.hash, "*")});
</script>
</body>
</html>