-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (48 loc) · 1.58 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="http://115.146.95.26:5984/_utils/script/jquery.js"></script>
<script src="http://115.146.95.26:5984/_utils/script/jquery.couch.js"></script>
<script type="text/javascript">
var map;
function getData(){
$.getJSON('http://115.146.95.26:5984/geomelbourne/_design/geo/_spatial/points?bbox=144.951422,-37.854625,144.989062,-37.799489', function(data) {
for (var i = 0; i < data.rows.length; i++) {
var coords = data.rows[i].geometry.coordinates;
// console.log(coords);
var latLng = new google.maps.LatLng(coords[1],coords[0]);
var marker = new google.maps.Marker({
position: latLng,
map: map
})
// console.log("marker" + [i])
}
});
}
function initialize() {
getData();
var myLatlng = new google.maps.LatLng(-37.804355,144.953694);
var mapOptions = {
zoom: 15,
center: myLatlng
}
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>