forked from zoejw/buses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuses.html
executable file
·50 lines (42 loc) · 1.12 KB
/
buses.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
<!DOCTYPE html>
<html>
<!-- google maps library -->
<script src="http://maps.google.com/maps/api/js"></script>
<!-- google map element -->
<div id="map" style="width:1024px; height:768px"></div>
<script src="utilities.js"></script>
<script>
// ------------------------------------
// single bus - static
// var locations = getBusLocations();
// var bus = locations.vehicle[4];
// addMarkers(bus);
// ------------------------------------
// YOUR CODE
// for (var i=0;i<locations.length;i++){
// var locations = getBusLocations();
// var bus = locations.vehicle[4];
// addMarkers(bus);
//}
// ------------------------------------
// all buses - static
// ------------------------------------
// YOUR CODE
// ------------------------------------
// all buses - timer
var showBuses = function(){
var locations =getBusLocations();
var length = locations.vehicle.length;
var bus = null;
for (var i =0; i<length; i++){
bus = locations.vehicle[i];
addMarkers(bus);
}
console.log(new Date());
};
showBuses();
setInterval(showBuses,15000);
// ------------------------------------
// YOUR CODE
</script>
</html>