-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
446 lines (358 loc) · 12.9 KB
/
main.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Circulator Planning Tool</title>
<!--link href="/static/css/default.css" type="text/css" rel="stylesheet" /-->
<script language="javascript" src="static/js/jquery-1.2.3.js"></script>
<script language="javascript" src="static/js/json2.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var map3y;
var map5y;
var map10y;
var markers3y = new Array();
var markersJS3y=new Array();
var routes3y = new Array();
var routesJS3y=new Array();
var markers5y = new Array();
var markersJS5y=new Array();
var routes5y = new Array();
var routesJS5y=new Array();
var markers10y = new Array();
var markersJS10y=new Array();
var routes10y = new Array();
var routesJS10y=new Array();
var state3y;
var loc3y;
var state5y;
var loc5y;
var state5y;
var loc5y;
function initialize() {
state="new";
state3y="new";
state5y="new";
state10y="new";
var latlng = new google.maps.LatLng(38.89545,-77.015871);
var myOptions = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map3y = new google.maps.Map(document.getElementById("map_canvas_3y"), myOptions);
map5y = new google.maps.Map(document.getElementById("map_canvas_5y"), myOptions);
map10y = new google.maps.Map(document.getElementById("map_canvas_10y"), myOptions);
google.maps.event.addListener(map3y, 'click', function(event) {
placeMarker3y(event.latLng);
});
google.maps.event.addListener(map5y, 'click', function(event) {
placeMarker5y(event.latLng);
});
google.maps.event.addListener(map10y, 'click', function(event) {
placeMarker10y(event.latLng);
});
google.maps.event.addListener(map3y, 'zoom_changed', function() {
var zoom = map3y.getZoom();
if (zoom!=map5y.getZoom()) map5y.setZoom(zoom);
if (zoom!=map10y.getZoom()) map10y.setZoom(zoom);
});
google.maps.event.addListener(map3y, 'center_changed', function() {
var cntr=map3y.getCenter();
if (cntr.toString()!=map5y.getCenter().toString()) map5y.setCenter(cntr);
if (cntr.toString()!=map10y.getCenter().toString()) map10y.setCenter(cntr);
});
google.maps.event.addListener(map5y, 'zoom_changed', function() {
var zoom = map5y.getZoom();
if (zoom!=map3y.getZoom()) map3y.setZoom(zoom);
if (zoom!=map10y.getZoom()) map10y.setZoom(zoom);
});
google.maps.event.addListener(map5y, 'center_changed', function() {
var cntr=map5y.getCenter();
if (cntr.toString()!=map3y.getCenter().toString()) map3y.setCenter(cntr);
if (cntr.toString()!=map10y.getCenter().toString()) map10y.setCenter(cntr);
});
google.maps.event.addListener(map10y, 'zoom_changed', function() {
var zoom = map10y.getZoom();
if (zoom!=map3y.getZoom()) map3y.setZoom(zoom);
if (zoom!=map5y.getZoom()) map5y.setZoom(zoom);
});
google.maps.event.addListener(map10y, 'center_changed', function() {
var cntr=map10y.getCenter();
if (cntr.toString()!=map5y.getCenter().toString()) map5y.setCenter(cntr);
if (cntr.toString()!=map3y.getCenter().toString()) map3y.setCenter(cntr);
});
var ctaLayer3y = new google.maps.KmlLayer('http://circulator-planning.appspot.com/static/data/routes.kml');
var ctaLayer5y = new google.maps.KmlLayer('http://circulator-planning.appspot.com/static/data/routes.kml');
var ctaLayer10y = new google.maps.KmlLayer('http://circulator-planning.appspot.com/static/data/routes.kml');
ctaLayer3y.setMap(map3y);
ctaLayer5y.setMap(map5y);
ctaLayer10y.setMap(map10y);
}
function placeMarker3y(location) {
var image="static/img/red_MarkerO.png";
if (state3y=="new") {
image="static/img/red_MarkerO.png";
state3y="in process";
loc3y=location;
}
else {
image="static/img/red_MarkerD.png";
state3y="new";
var path = [loc3y,location];
var route3y = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 0.5,strokeWeight: 10});
route3y.setMap(map3y);
routes3y.push(route3y);
var route5y = new google.maps.Polyline({path: path,strokeColor: "#0000FF",strokeOpacity: 0.5,strokeWeight: 10});
route5y.setMap(map5y);
routes5y.push(route5y);
var route10y = new google.maps.Polyline({path: path, strokeColor: "#00FF00",strokeOpacity: 0.5, strokeWeight: 10});
route10y.setMap(map10y);
routes10y.push(route10y);
var routeJS3y={"origin_lat":loc3y.lat(), "origin_long":loc3y.lng(),"destination_lat":location.lat(), "destination_long":location.lng()};
routesJS3y.push(routesJS3y);
}
//alert("start marker");
var marker3y = new google.maps.Marker({position: location, map: map3y,icon:image});
markers3y.push(marker3y);
var markerJS3y={"type":state3y,"lat":location.lat(), "long":location.lng()};
markersJS3y.push(markerJS3y);
//alert("end marker");
}
function placeMarker5y(location) {
var image="static/img/red_MarkerO.png";
if (state5y=="new") {
image="static/img/red_MarkerO.png";
state5y="in process";
loc5y=location;
}
else {
image="static/img/red_MarkerD.png";
state5y="new";
var path = [loc5y,location];
var route5y = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 0.5,strokeWeight: 10});
route5y.setMap(map5y);
routes5y.push(route5y);
var route10y = new google.maps.Polyline({path: path, strokeColor: "#0000FF",strokeOpacity: 0.5, strokeWeight: 10});
route10y.setMap(map10y);
routes10y.push(route10y);
var routeJS5y={"origin_lat":loc5y.lat(), "origin_long":loc5y.lng(),"destination_lat":location.lat(), "destination_long":location.lng()};
routesJS5y.push(routesJS5y);
}
//alert("start marker");
var marker5y = new google.maps.Marker({position: location, map: map5y,icon:image});
markers5y.push(marker5y);
var markerJS5y={"type":state5y,"lat":location.lat(), "long":location.lng()};
markersJS5y.push(markerJS5y);
//alert("end marker");
}
function placeMarker10y(location) {
var image="static/img/red_MarkerO.png";
if (state10y=="new") {
image="static/img/red_MarkerO.png";
state10y="in process";
loc10y=location;
}
else {
image="static/img/red_MarkerD.png";
state10y="new";
var path = [loc10y,location];
var route10y = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 0.5,strokeWeight: 10});
route10y.setMap(map10y);
routes10y.push(route10y);
var routeJS10y={"origin_lat":loc10y.lat(), "origin_long":loc10y.lng(),"destination_lat":location.lat(), "destination_long":location.lng()};
routesJS10y.push(routesJS10y);
}
//alert("start marker");
var marker10y = new google.maps.Marker({position: location, map: map10y,icon:image});
markers10y.push(marker10y);
var markerJS10y={"type":state10y,"lat":location.lat(), "long":location.lng()};
markersJS10y.push(markerJS10y);
//alert("end marker");
}
function resetMap3y(){
for (m=0; m<markers3y.length; m++)
{
markers3y[m].setMap(null);
}
markers3y=new Array();
markersJS3y= new Array();
}
function resetMap5y(){
for (m=0; m<markers5y.length; m++)
{
markers5y[m].setMap(null);
}
markers5y=new Array();
markersJS5y= new Array();
}
function resetMap10y(){
for (m=0; m<markers10y.length; m++)
{
markers10y[m].setMap(null);
}
markers10y=new Array();
markersJS10y= new Array();
}
function formSubmit(){
document.cabisurvey.data.value=JSON.stringify(markersJS);
return true;
}
</script>
</head>
<body onload="initialize()">
<center>
<h1>This is just a beta, don't submit your responses, yet!</h1>
<table width="1000px">
<tr>
<td colspan="2" bgcolor="red">
<img src="/static/img/circulator_logo.png"/><font face="Helvetica, Arial" size="48px" color="white"> <b>Planning Survey</b></font>
</td>
</tr>
<tr>
<td width="800" align="left">
Welcome! The goal of this survey is to engage the public to suggest expansion for DC Circulator bus system for next 1, 5, 10 years.
<br/>
<br/>
We will conduct two surveys to collect feedback on general "corridors" that should be served by Circulator, and then detailed information
about routes/bus stops in defined "corridors". This is survey #1, come back in couple of weeks for survey #2!
<br/>
<br/>
<form id="cabisurvey" name="cabisurvey" method="POST" action="/survey">
<input type="hidden" name="data" id="data"/>
<div id="part1">
<b>Step 1 - Define new "corridors" connecting locations in DC that should be served by Circulator</b>
<br/>
Use map below to roughly define locations in DC that should be connected by future Circulator routes. It can be extensions to existing routes, or new locations not
connected to the existing routes.
<br/>
<br/>
<hr width="100%"/>
<b>next 3 years</b>
<br/>
<center>
<div id="map_canvas_3y" style="width:750px; height:450px"></div>
<!--<input type="radio" name="group0" id="group0" value="Yes" checked> Origin
<input type="radio" name="group0" id="group0" value="No"> Destination -->
<input type="button" value="Reset map" onclick="javascript:resetMap3y();"/>
</center>
</div>
<br/>
<br/>
<div id="part0">
Please, explain in as much details as possible rationale for added locations/connections that you proposed:
<textarea cols="100" rows="5" name="explanation"></textarea> <br/>
<br/>
</div>
<br/>
<div id="part1">
<hr width="100%"/>
<b>next 5 years</b>
<center>
<div id="map_canvas_5y" style="width:750px; height:450px"></div>
<!--<input type="radio" name="group0" id="group0" value="Yes" checked> Origin
<input type="radio" name="group0" id="group0" value="No"> Destination -->
<input type="button" value="Reset map" onclick="javascript:resetMap5y();"/>
</center>
</div>
<br/>
<br/>
<div id="part0">
Please, explain in as much details as possible rationale for added locations/connections that you proposed:
<textarea cols="100" rows="5" name="explanation"></textarea> <br/>
<br/>
</div>
<br/>
<div id="part1">
<hr width="100%"/>
<b>next 10 years</b>
<br/>
<center>
<div id="map_canvas_10y" style="width:750px; height:450px"></div>
<!--<input type="radio" name="group0" id="group0" value="Yes" checked> Origin
<input type="radio" name="group0" id="group0" value="No"> Destination -->
<input type="button" value="Reset map" onclick="javascript:resetMap10y();"/>
</center>
</div>
<br/>
<br/>
<div id="part0">
Please, explain in as much details as possible rationale for added locations/connections that you proposed:
<textarea cols="100" rows="5" name="explanation"></textarea> <br/>
<br/>
</div>
<br/>
<hr width="100%"/>
<br/>
<div id="part2">
<b>Step 2 - Rider's profile</b>
<br/>
<br/>
Do you ride Circulator?:
<input type="radio" name="group1" value="Yes"> Yes
<input type="radio" name="group1" value="No"> No <br/>
<br/>
How/when you ride Circulator?:
<input type="checkbox" name="group2" value="Commute"> Daily commute to work
<input type="checkbox" name="group2" value="Lunch"> Lunch
<input type="checkbox" name="group2" value="Evening"> Evening outings
<input type="checkbox" name="group2" value="Weekends"> Weekends
<input type="checkbox" name="group2" value="Other"> Other <br/>
</div>
<br/>
<br/>
<div id="part3">
<b>Step 3 - Sign up for updates</b> (optional)
<br/>
<br/>
Your email address: <input type="text" size="75" name="email" value=""/>
</div>
<br/>
<br/>
<input type="submit" value="Submit!" onclick="javascript:formSubmit();">
</form>
</td>
<td width="200" valign="top">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: 'DCCirculator',
interval: 6000,
title: 'Twitter Stream',
subject: 'DC Circulator',
width: 250,
height: 300,
theme: {
shell: {
background: '#8ec1da',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: false,
loop: true,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
toptweets: true,
behavior: 'default'
}
}).render().start();
</script>
</td>
</tr>
<tr>
<td colspan="2">
Learn more about <a href="http://dccirculator.com">DC Circulator</a>.
</td>
</tr>
</table>
</center>
{% block body %}{% endblock %}
</body>