-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
140 lines (129 loc) · 4.85 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=1024, user-scalable=no">
<link href="css/leaflet.css" rel="stylesheet" />
<link href="css/map.css" rel="stylesheet" />
<script src="dist/jquery.js"></script>
<script src="dist/underscore.js"></script>
<script src="dist/backbone.js"></script>
<script src="dist/leaflet.js"></script>
<script src="map.backbone.js"></script>
<title>GTFS Transvisor</title>
<style>
html, body {
font-size: 10pt;
}
#transvisor- {
margin: 0px;
width: 350px;
float: left;
height: 100%;
overflow: scroll;
}
#transvisor-map {
margin: 0px;
margin-left: 350px;
height: 100%;
}
</style>
</head>
<body>
<div id="transvisor-">
<form id="transvisor-service">
<input type="hidden" name="agency" />
<select name="service">
<option>Weekday</option>
</select>
<select name="start">
<option value="0">Midnight</option>
<option value="3600">1 am</option>
<option value="7200">2 am</option>
<option value="10800">3 am</option>
<option value="14400">4 am</option>
<option value="18000">5 am</option>
<option value="21600">6 am</option>
<option value="25200" selected="selected">7 am</option>
<option value="28800">8 am</option>
<option value="32400">9 am</option>
<option value="36000">10 am</option>
<option value="39600">11 am</option>
<option value="43200">Noon</option>
<option value="46800">1 pm</option>
<option value="50400">2 pm</option>
<option value="54000">3 pm</option>
<option value="57600">4 pm</option>
<option value="61200">5 pm</option>
<option value="64800">6 pm</option>
<option value="68400">7 pm</option>
<option value="72000">8 pm</option>
<option value="75600">9 pm</option>
<option value="79200">10 pm</option>
<option value="82800">11 pm</option>
</select>
<select name="end">
<option value="0">Midnight</option>
<option value="3600">1 am</option>
<option value="7200">2 am</option>
<option value="10800">3 am</option>
<option value="14400">4 am</option>
<option value="18000">5 am</option>
<option value="21600">6 am</option>
<option value="25200">7 am</option>
<option value="28800">8 am</option>
<option value="32400" selected="selected">9 am</option>
<option value="36000">10 am</option>
<option value="39600">11 am</option>
<option value="43200">Noon</option>
<option value="46800">1 pm</option>
<option value="50400">2 pm</option>
<option value="54000">3 pm</option>
<option value="57600">4 pm</option>
<option value="61200">5 pm</option>
<option value="64800">6 pm</option>
<option value="68400">7 pm</option>
<option value="72000">8 pm</option>
<option value="75600">9 pm</option>
<option value="79200">10 pm</option>
<option value="82800">11 pm</option>
</select>
<input type="submit" value="Show LOS" />
</form>
</div>
<div id="transvisor-map"></div>
<div style="clear:both"></div>
<script>
// Setup the map.
var mbAttr = 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>'
var mbUrl = 'https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png';
var grayscale = L.tileLayer(mbUrl, {id: 'examples.map-20v6611k', attribution: mbAttr});
var streets = L.tileLayer(mbUrl, {id: 'examples.map-i86nkdio', attribution: mbAttr});
var leaflet = L.map('transvisor-map', {
center: [0,0],
zoom: 2,
layers: [streets]
});
var baseLayers = {
"Grayscale": grayscale,
"Streets": streets
};
L.control.layers(baseLayers).addTo(leaflet);
var agency = get_qs('agency') || 'actransit';
$("#transvisor-service input[name=agency]").val(agency);
var start = parseInt(get_qs('start')) || 7 * 3600;
var end = parseInt(get_qs('end')) || 9 * 3600;
$("#transvisor-service select[name=start]").val(start);
$("#transvisor-service select[name=end]").val(end);
var App = new TransvisorApp({
el: $("#transvisor-"),
leaflet: leaflet,
url: 'data/' + agency + '.geojson',
start: start,
end: end
});
</script>
</body>
</html>