Questo è il seguente codice che sto usando per creare una mia google maps con più punti maker. L'unico problema che ho è che non riesco ad aggiungere l'evento onclick per aprire i maker...
Questo è il codice che uso nelle altre mappe, che non riesco a integrare in questa mappa con il maker cluster. Ho provato in tutti i modi eppure non vuole andare, va tutto però se apro il maker non succede nulla...
codice:
google.maps.event.addListener(marker, "click", function() {
if (infowindow) infowindow.close();
infowindow = new google.maps.InfoWindow({content: tooltip});
infowindow.open(map, marker);
});
Codice della mappa
codice:
<script type="text/javascript">
function initialize() {
var center = new google.maps.LatLng(37.4419, -122.1419);
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var markers = [];
for (var i = 0; i < 100; i++) {
var dataPhoto = data.photos[i];
var latLng = new google.maps.LatLng(dataPhoto.latitude,
dataPhoto.longitude);
var marker = new google.maps.Marker({
position: latLng
});
var marker = new google.maps.Marker(
{
position: latLng,
map: map,
icon: 'immagine maker',
flat: true
}
);
markers.push(marker);
}
var markerCluster = new MarkerClusterer(map, markers);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
Per intenderci la mappa sarebbe questa
http://google-maps-utility-library-v...e_example.html
Però i miei maker dovrebbero aprirsi con le info del punto, sono riuscito a mettere l'icona personalizzata però l'altro pezzo di codice non riesco proprio a integrarlo...