<script type='text/javascript'><!--
var map;
function initialize() {
var center = new google.maps.LatLng($coordinates);
var myOptions = {
zoom: $ZoomHeaderMap,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP,
maxZoom: 50,
scrollwheel: false
};
var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
";
//Вывод информации из БД
$query= mysql_query("SELECT * FROM $TableNameGoogleMaps ORDER BY id");
while ($row=mysql_fetch_array($query))
{
$idMarker = $row['id'];
$transliterate_title_map = $row['transliterate_title'];
$address = $row['address'];
$img = $row['img'];
$title = $row['title'];
$info = $row['info'];
$result = mysql_query("SELECT * FROM images WHERE id='$img' ORDER BY id");
while ($myrow=mysql_fetch_array($result))
{
$ImgName = $myrow['name'];
}
$coordinates = $row['coordinates'];
$info = "<div id='infoContent'><img src='images/$ImgName' title='$address' alt='$title' width='179' height='119'><br><a href='$link_appartment$transliterate_title_map.html'>$title</a><br>$address</div>";
$result = explode(",", $coordinates);
echo "
var contentString$idMarker = \"$info\";
var infowindow$idMarker = new google.maps.InfoWindow({
content: contentString$idMarker
});
var marker$idMarker = new google.maps.Marker({
position: {lat: $result[0], lng: $result[1]},
map: map,
title: '$title',
animation: google.maps.Animation.DROP,
visible: true,
icon: \"images/beachflag.png\"
});
google.maps.event.addListener(marker$idMarker, \"click\", function() {
infowindow$idMarker.open(map,marker$idMarker);
});
";
}
echo "
}
</script>
";
Подскажите, куда что добавить чтобы работала кластеризация?