-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest3.html
executable file
·41 lines (39 loc) · 1.83 KB
/
test3.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
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="js/markerclustererplus-2.0.6/markerclusterer.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.map.js"></script>
<link rel="stylesheet" type="text/css" href="map.css">
<link href='http://fonts.googleapis.com/css?family=Josefin+Slab' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<br>
<div id="map_canvas" ></div>
</br>
<script type="text/javascript">
$('#map_canvas').gmap({'zoom': 2, 'disableDefaultUI':true}).bind('init', function(evt, map) {
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var lngSpan = northEast.lng() - southWest.lng();
var latSpan = northEast.lat() - southWest.lat();
for ( var i = 0; i < 1000; i++ ) {
var lat = southWest.lat() + latSpan * Math.random();
var lng = southWest.lng() + lngSpan * Math.random();
$('#map_canvas').gmap('addMarker', {
'position': new google.maps.LatLng(lat, lng)
}).click(function() {
$('#map_canvas').gmap('openInfoWindow', { content : 'Hello world!' }, this);
});
}
$('#map_canvas').gmap('set', 'MarkerClusterer', new MarkerClusterer(map, $(this).gmap('get', 'markers')));
// To call methods in MarkerClusterer simply call
// $('#map_canvas').gmap('get', 'MarkerClusterer').callingSomeMethod();
});
</script>
</body>
</html>