<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="src/data.json"></script>
<script type="text/javascript">
var script = '<script type="text/javascript" src="src/markerclusterer';
if (document.location.search.indexOf('packed') !== -1) {
script += '_packed';
}
if (document.location.search.indexOf('compiled') !== -1) {
script += '_compiled';
}
script += '.js"><' + '/script>';
document.write(script);
google.load('maps', '3', {
other_params: 'sensor=true'
});
google.setOnLoadCallback(init);
function init() {
var center = new google.maps.LatLng(center_lat, center_lng);
var map = new google.maps.Map(document.getElementById('map'), {
zoom: poiZoomLevel,
center: center,
mapTypeControl: false,
mapTypeId: google.maps.MapTypeId.SATELLITE
});
var markers = [];
<?php $sql2="select * from poi ";
$query2=mysql_query($sql2);
while($result2=mysql_fetch_array($query2)){?>
var latLng = new google.maps.LatLng(<?=$result2["lat"];?>,
<?=$result2["lng"];?>);
var marker = new google.maps.Marker({
position: latLng
});
markers.push(marker);
<?php }?>
var markers2 = [];
var latLng = new google.maps.LatLng(center_lat,
center_lng);
var marker2 = new google.maps.Marker({
position: latLng
});
markers2.push(marker2);
var markerCluster2 = new MarkerClusterer(map, markers2);
var markerCluster = new MarkerClusterer(map, markers);
}
</script>