-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
430 lines (359 loc) · 9.91 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
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
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body, #map-canvas {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
var map;
//var geocoder;
//initialize the map
function initialize() {
//geocoder = new google.maps.Geocoder();
var mapOptions = {
zoom: 5,
center: new google.maps.LatLng(40, -100),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
addMarker();
}
//var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
//map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
// var marker = new google.maps.Marker({
// position: myLatlng,
// map: map,
// title: 'Hello World!'
// });
// //
// //codeAddress('Deerfield, IL');
// //codeAddress('Yazoo City, MS');
// var delay = 100;
// var locations = [
// "Compton, CA",
// "El Segundo, CA",
// "Colorado Springs, CO",
// "Tulsa, OK",
// "Hughes, AR",
// "Yazoo City,MS",
// "Metairie, LA",
// "New Orleans, LA",
// "Smyrna, Georgia",
// "Hilton Head Island, SC",
// "Waldorf, MD",
// "Waldorf, MD",
// "Capitol Heights, MD",
// "Brooklandville, MD",
// "Philadelphia,PA",
// "Newark, NJ",
// "Brookline, MA",
// "Marshfield, MA",
// "Bourne, MA",
// "Cape Elizabeth, ME",
// "Cumberland, ME",
// "St. Johnsbury, VT",
// "Chicago, IL",
// "Elk Grove Village, IL",
// "Spring Grove, IL",
// "Portland, OR",
// "Sacremento, CA"
// ];
// console.log("the number of schools is " + locations.length);
// var i = 0;
// var loop = setInterval(function(){
// codeAddress(locations[i]);
// i++;
// if (i == locations.length) {
// clearInterval(loop);
// }
// },1000);
// var LOCATIONS = [
// {
// "lat": 33.8958492,
// "lng": -118.2200712,
// "city": "Compton, CA",
// "name": "Compton High School"
// },
// {
// "lat": 33.9191799,
// "lng": -118.4164652,
// "city": "El Segundo, CA",
// "name": "El Segundo High School"
// },
// {
// "lat": 38.8338816,
// "lng": -104.8213634,
// "city": "Colorado Springs, CO",
// "name": "Pikes Peak Prep"
// },
// {
// "lat": 36.1539816,
// "lng": -95.992775,
// "city": "Tulsa, OK",
// "name": "Union High School"
// },
// {
// "lat": 34.9492613,
// "lng": -90.47149050000002,
// "city": "Hughes, AR",
// "name": "Hughes High School"
// },
// {
// "lat": 32.8551326,
// "lng": -90.4056468,
// "city": "Yazoo City,MS",
// "name": "Woolfolk Middle School"
// },
// {
// "lat": 29.9840922,
// "lng": -90.15285189999997,
// "city": "Metairie, LA",
// "name": "Grace King High School"
// },
// {
// "lat": 29.95106579999999,
// "lng": -90.0715323,
// "city": "New Orleans, LA",
// "name": "Sci Academy"
// },
// {
// "lat": 33.8839926,
// "lng": -84.51437609999999,
// "city": "Smyrna, GA",
// "name": "Campbell High School"
// },
// {
// "lat": 32.216316,
// "lng": -80.75260800000001,
// "city": "Hilton Head Island, SC",
// "name": "Hilton Head Island High School"
// },
// {
// "lat": 38.6265124,
// "lng": -76.91054830000002,
// "city": "Waldorf, MD",
// "name": "Westlake High School"
// },
// //this school is in the same city
// {
// "lat": 38.6265124,
// "lng": -76.91054830000002,
// "city": "Waldorf, MD",
// "name": "North Point High School"
// },
// {
// "lat": 38.8851122,
// "lng": -76.91580679999998,
// "city": "Capitol Heights, MD",
// "name": "Fairmont Heights High School"
// },
// {
// "lat": 39.420384,
// "lng": -76.6699711,
// "city": "Brooklandville, MD",
// "name": "St. Paul's School"
// },
// {
// "lat": 39.952335,
// "lng": -75.16378900000001,
// "city": "Philadelphia,PA",
// "name": "Crossroads Academy"
// },
// {
// "lat": 40.735657,
// "lng": -74.1723667
// "city": "Newark, NJ",
// "name": "North Star Academy Charter School"
// },
// //this city has changed
// {
// "lat": 42.33176419999999,
// "lng": -71.12116349999997,
// "city": "Brookline, MA",
// "name": "Beaver Country Day School"
// },
// {
// "lat": 42.0917453,
// "lng": -70.7055871,
// "city": "Marshfield, MA",
// "name": "Marshfield High School"
// },
// {
// "lat": 41.74127730000001,
// "lng": -70.59893249999999,
// "city": "Bourne, MA",
// "name": "Upper Cape Cod Regional Technical High School"
// },
// {
// "lat": 43.563696,
// "lng": -70.20004670000003,
// "city": "Cape Elizabeth, ME",
// "name": "Cape Elizabeth High School"
// },
// {
// "lat": 43.7685392,
// "lng": -70.23285450000003,
// "city": "Cumberland, ME",
// "name": "Greely High School"
// },
// {
// "lat": 44.4192627,
// "lng": -72.01511829999998,
// "city": "St. Johnsbury, VT",
// "name": "St. Johnsbury Academy"
// },
// {
// "lat": 41.8781136,
// "lng": -87.62979819999998,
// "city": "Chicago, IL",
// "name": "Mather High School"
// },
// {
// "lat": 42.0039178,
// "lng": -87.97034610000003,
// "city": "Elk Grove Village, IL",
// "name": "Elk Grove High School"
// },
// {
// "lat": 42.4436308,
// "lng": -88.23647749999998,
// "city": "Spring Grove, IL",
// "name": "Homeschool"
// },
// {
// "lat": 45.5234515,
// "lng": -122.6762071,
// "city": "Portland, OR",
// "name": "Cathedral School"
// },
// {
// "lat": 38.5815719,
// "lng": -121.49439960000001,
// "city": "Sacremento, CA",
// "name": "The Met Sacramento"
// }
// ];
//add a marker to the map
function addMarker(){
//var name = name;
var lats = [33.8958492, 33.9191799];
var lngs = [-118.2200712, -118.4164652];
//for(var i = 0; i < lats.length; i++){
var myLatlng = new google.maps.LatLng(lats[1], lngs[1]);
console.log(lats[1], lngs[1]);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
});
return marker;
//}
// var myLatlng = new google.maps.LatLng(33.8958492, -118.2200712);
// var marker = new google.maps.Marker({
// position: myLatlng,
// map: map,
// //title: 'Hello World'
// });
// console.log("about to do a marker");
// return marker;
}
//addMarker();
// // Add the marker on the map for this place
// //function addMarker(location, id?)
// function addMarker(location){
// //console.log(tacoPlace);
// var name = location.name;
// var myLatlng = new google.maps.LatLng(location.lat, location.lng);
// var marker = new google.maps.Marker({
// position: myLatlng,
// map: map,
// title: name
// });
// return marker;
// }
// //make array of locations to add for markers
// }
// function codeAddress(address) {
// geocoder.geocode( { 'address': address}, function(results, status) {
// // console.log(results);
// if (status == google.maps.GeocoderStatus.OK) {
// map.setCenter(results[0].geometry.location);
// var marker = new google.maps.Marker({
// map: map,
// position: results[0].geometry.location
// });
// console.log(results[0].geometry.location.jb);
// console.log(results[0].geometry.location.kb);
// console.log("---");
// } else {
// alert('Geocode was not successful for the following reason: ' + status);
// }
// });
// }
// // Set the box to open when you click this marker
// function getClickBox(info){
// var rating = info.rating;
// var html = "<div class='info-item taco-box "+info.hash+"' data-id='"+info.idx+"'><div class='name'>";
// html += info.name;
// html += "</div><div class='addr'>";
// html += info.addr;
// html += "</div><div class='rating'>";
// html += "My Rating: " + "<span class='rr'>"+rating+"</span> <div class='slider'></div>";
// html += "<div class='visit-wrap'><a href='#' class='btn btn-primary visit-btn'>Visited!</a>Vists: <span class='num-visits'>"+info.num_visits+"</span></div>";
// html += "</div></div>";
// var infowindow = new google.maps.InfoWindow({
// content: html,
// size: new google.maps.Size(50,50)
// });
// return infowindow;
// }
// function clickEvents(info){
// // When a taco shop is clicked, focus in
// function showPopup(info){
// closeAll();
// if(!info.open){
// info.infowindow.open(map, info.marker);
// makeSliders(info);
// visitedButton(info);
// }else{
// info.infowindow.close();
// }
// info.open = !info.open;
// }
// // For clicking on a marker
// google.maps.event.addListener(info.marker, 'click', function(event) {
// showPopup(info);
// });
// // For clicking on the side list
// $(".taco-click[data-id='"+info.idx+"']").click(function(){
// showPopup(info);
// });
// }
// // Add the marker on the map for this place
// //function addMarker(location, id?)
// function addMarker(location){
// //console.log(tacoPlace);
// var name = location.name;
// var myLatlng = new google.maps.LatLng(location.lat, location.lng);
// var marker = new google.maps.Marker({
// position: myLatlng,
// map: map,
// title: name
// });
// return marker;
// }
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>