Clusters are created on my maps, but when markers have the same addresses, when clicking on a cluster, the tooltip is not shown. I am using Gmaps Marker Clusterer. Code example: ` function initMap(){ // map options var options = { zoom:7, center:{lat:53.3938131, lng:-7.858913} } var map = new google.maps.Map(document.getElementById('map'),options); // Add a marker clusterer to manage the markers.
//Add marker
var markers = [
//Dublin
{
coords:{lat:53.338741, lng:-6.261563},
iconImage:'assets/img/places/stparkdublin.png',
content:'<h1>St Stephen’s Green</h1>'+ '<br>' + '<h2>Learn More</h2>' + '<a>http://ststephensgreenpark.ie/</a>'
},
{
//coords:{lat:53.3755012,lng:-6.2735677},
coords:{lat:53.338741, lng:-6.261563},
iconImage:'assets/img/places/botanic garden.png',
content:'<h1>Botanic Garden</h1>' + '<br>' + '<h2>Learn More</h2>' + '<a>http://botanicgardens.ie/</a>'
}
];
// Loop through markers
var gmarkers = [];
for(var i = 0; i < markers.length; i++){
gmarkers.push(addMarker(markers[i]));
}
//Add MArker function
function addMarker(props){
var marker = new google.maps.Marker({
position:props.coords,
map:map,
});
/* if(props.iconImage){
marker.setIcon(props.iconImage);
} */
//Check content
if(props.content){
var infoWindow = new google.maps.InfoWindow({
content:props.content
});
marker.addListener('click',function(){
infoWindow.open(map,marker);
});
}
return marker;
}
var markerCluster = new MarkerClusterer(map, gmarkers,
{
imagePath:
'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'
});
}
google.maps.event.addDomListener(window, 'load', initMap)
</script>