-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.html
46 lines (36 loc) · 1.18 KB
/
footer.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
};
var mapOptions = {
zoom: 12,
center: new google.maps.LatLng(1, 1),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var infoWindow = new google.maps.InfoWindow();
for (var url in myLatLngs) {
var myLatlng = myLatLngs[url][1];
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
url: url,
title: myLatLngs[url][0]
});
google.maps.event.addListener(marker, 'click', function() {
content = '<a href="' + this.url + '">' + this.title + '</a>';
infoWindow.setContent(content);
infoWindow.open(map, this);
});
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
map.setCenter(initialLocation);
});
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>