-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
69 lines (60 loc) · 1.99 KB
/
map.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta charset="utf-8">
<title>Map of PGW Worksites</title>
<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
<style>
html, body, #map {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var locations = [
['Worksite #1', 39.95, -75.15],
['Worksite #2', 39.95, -75.25],
['Worksite #3', 39.95, -75.35],
['Worksite #4', 39.95, -75.45],
['Worksite #5', 39.95, -75.55]
];
// TODO - Getting too many permission errors, need to run this on a web server to avoid them
// $.getJSON("http://www.cs.drexel.edu/~cera/pgw-projects.csv", function (data) {
// var locations = data;
// console.log("blah");
// iw = new google.maps.InfoWindow();
// for (var i = 0; i < locations.length; i++) {
// var location = locations[i].company;
// addMarker(location);
// }
// });
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
center: new google.maps.LatLng(39.95,-75.15),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
</body>
</html>