-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
222 lines (184 loc) · 5.77 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
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Capital Bikeshare</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 map;
var markers = new Array();
var markersJS=new Array();
function initialize() {
var latlng = new google.maps.LatLng(38.89545,-77.015871);
var myOptions = {
zoom: 12,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {
placeMarker(event.latLng);
});
}
function placeMarker(location) {
var val=$("input[name='group0']:checked").val();
var mode="";
var image="static/img/red_MarkerO.png";
if (val=="Yes") {
mode="Origin";
image="static/img/red_MarkerO.png";
}
else {
mode="Destination";
image="static/img/red_MarkerD.png";
}
//var clickedLocation = new google.maps.LatLng(location);
//var image = 'http://google-maps-icons.googlecode.com/files/cycling.png';
var marker = new google.maps.Marker({
position: location,
map: map,
icon:image
});
markers.push(marker);
var markerJS={"type":mode,"lat":location.lat(), "long":location.lng()};
markersJS.push(markerJS);
//alert(JSON.stringify(markersJS));
//map.setCenter(location);
}
function resetMap(){
for (m=0; m<markers.length; m++)
{
markers[m].setMap(null);
}
markers=new Array();
markersJS= new Array();
}
function formSubmit(){
document.cabisurvey.data.value=JSON.stringify(markersJS);
return true;
}
</script>
</head>
<body onload="initialize()">
<h1>{% block title %}{% endblock %}</h1>
<center>
<table width="1000px">
<tr>
<td colspan="2" bgcolor="red">
<br/>
<font face="Helvetica, Arial" size="48px" color="white"> <b>Capital Bikeshare Survey</b></font>
<br/>
<br/>
</td>
</tr>
<tr>
<td width="800" align="left">
Welcome! The goal of this survey is to engage the public to suggest locations for the new Capital Bikeshare bike-sharing stations.
<br/>
<br/>
<form id="cabisurvey" name="cabisurvey" method="POST" action="/survey">
<input type="hidden" name="data" id="data"/>
<div id="part1">
<b>Step 1 - Select points of origin and destination</b>
<br/>
Use selector below map to alternate between origin and destination points. Points of origin are locations where you usually will pick up a bike, such us your home, office, metro or bus station. Points of destination are locations where you usually will be dropping off a bike, such as shops, restaurants, museums, etc.
<br/>
<center>
<div id="map_canvas" 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:resetMap();"/>
</center>
</div>
<br/>
<br/>
<div id="part2">
<b>Step 2 - Your commuter 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 do you get to work?:
<input type="checkbox" name="group2" value="Bike"> Bike
<input type="checkbox" name="group2" value="Walk"> Walk
<input type="checkbox" name="group2" value="Bus"> Bus
<input type="checkbox" name="group2" value="Metro"> Metro
<input type="checkbox" name="group2" value="Car"> Car<br/>
</div>
<br/>
<br/>
<div id="part3">
<b>Step 2 - SmartBike and Capital Bikeshare</b>
<br/>
<br/>
Are you current SmartBike member?:
<input type="radio" name="group3" value="Yes"> Yes
<input type="radio" name="group3" value="No"> No <br/>
<br/>
Will you join Capital Bikeshare when it will launch this fall?:
<input type="radio" name="group4" value="Yes"> Yes
<input type="radio" name="group4" value="No"> No <br/>
<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: 'Capital Bikeshare',
interval: 6000,
title: 'Capital Bikeshare',
subject: 'CaBi is coming!',
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://ddot.dc.gov/DC/DDOT/On+Your+Street/Bicycles+and+Pedestrians/Bicycles/Bicycle+Program">DC Bicycle Program</a>
</td>
</tr>
</table>
</center>
{% block body %}{% endblock %}
</body>