Hjælp til Google Map ver3 - Markerclusterer
Jeg forsøger at få markerclusterer til at virke men uden held. Her er min kode:<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="/googlemap/ver3/markerclusterer/src/markerclusterer.js"></script>
<script>
var geocoder;
var map;
var places = [
['Maroubra Beach3', -32.950198, 151.259302, 1],
['Maroubra Beach4', -31.950198, 151.259302, 4],
['Maroubra Beach5', -30.950198, 151.259302, 3],
['Maroubra Beach5', -30.950198, 151.559313, 5],
['Maroubra Beach5', -30.950198, 151.659315, 7],
];
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(-31.950198, 151.259302);
var mapOptions = {
zoom: 7,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
for (var i = 0; i < places.length; i++) {
var place = places[i];
var myLatLng = new google.maps.LatLng(place[1], place[2]);
var marker = new google.maps.Marker({
position: myLatLng,
map: map
})
}
places.push(place);
var markerCluster = new MarkerClusterer(map, marker);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<body onLoad="initialize(); ">
<div id="map-canvas" style="width: 620px; height: 480px;"></div>
-------------------------
Stederne bliver vist som de skal og der kommer ingen fejlmeddelelser, men cluster virker ikke. To der ligger lige oveni hinanden bliver stadig vist med to ikoner.
hjælp :)