02.
<script type=
"text/javascript"
src=
"src/data.json"
></script>
03.
<script type=
"text/javascript"
>
04.
var
script =
'<script type="text/javascript" src="src/markerclusterer'
;
05.
if
(document.location.search.indexOf(
'packed'
) !== -1) {
06.
script +=
'_packed'
;
07.
}
08.
if
(document.location.search.indexOf(
'compiled'
) !== -1) {
09.
script +=
'_compiled'
;
10.
}
11.
script +=
'.js"><'
+
'/script>'
;
12.
document.write(script);
13.
14.
google.load(
'maps'
,
'3'
, {
15.
other_params:
'sensor=true'
16.
});
17.
google.setOnLoadCallback(init);
18.
19.
function
init() {
20.
var
center =
new
google.maps.LatLng(center_lat, center_lng);
21.
22.
var
map =
new
google.maps.Map(document.getElementById(
'map'
), {
23.
zoom: poiZoomLevel,
24.
center: center,
25.
mapTypeControl: false,
26.
mapTypeId: google.maps.MapTypeId.SATELLITE
27.
});
28.
29.
var
markers = [];
30.
31.
<?php
$sql2
=
"select * from poi "
;
32.
$query2
=mysql_query(
$sql2
);
33.
while
(
$result2
=mysql_fetch_array(
$query2
)){?>
34.
var
latLng =
new
google.maps.LatLng(<?=
$result2
[
"lat"
];?>,
35.
<?=
$result2
[
"lng"
];?>);
36.
var
marker =
new
google.maps.Marker({
37.
position: latLng
38.
});
39.
markers.push(marker);
40.
<?php }?>
41.
42.
var
markers2 = [];
43.
var
latLng =
new
google.maps.LatLng(center_lat,
44.
center_lng);
45.
var
marker2 =
new
google.maps.Marker({
46.
position: latLng
47.
});
48.
markers2.push(marker2);
49.
var
markerCluster2 =
new
MarkerClusterer(map, markers2);
50.
51.
var
markerCluster =
new
MarkerClusterer(map, markers);
52.
}
53.
54.
55.
</script>