-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
54 lines (53 loc) · 1.42 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
<html>
<head>
<title>LogMapper</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
height: 100%
}
body {
height: 100%;
margin: 0;
padding: 0
}
#map_canvas {
height: 100%
}
</style>
</head>
<body>
<div id="map_canvas" style="width:100%; height:100%"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=GOOGLE_MAPS_API_KEY&sensor=true"></script>
<script src="/nowjs/now.js"></script>
<script type="text/javascript">
var map = null;
$(document).ready(function(){
drawMap();
now.receiveMessage = function(messages){
dropMarkers(messages);
}
});
function drawMap() {
var latlng = new google.maps.LatLng(39.109722, -94.588611);
var myOptions = {
zoom : 5,
center : latlng,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
function dropMarkers(markers){
for(var i in markers){
var coord = markers[i].split(',');
new google.maps.Marker({
position : new google.maps.LatLng(parseFloat(coord[0]), parseFloat(coord[1])),
animation: google.maps.Animation.DROP,
map : map
});
}
}
</script>
</body>
</html>