it's generally recommended that you make one infowindow and change its
location and contents according to where the click took place.
I suspect that your code should look something like this, but if it is
a scope issue there's nothing like a good link to your map...
var iwindow = new google.maps.InfoWindow()
for (var i = 0; i < markerArray.length; i++){
google.maps.event.addListener(markerCluster, 'clusterclick',
function(event) {
if (map.getZoom() == 8) {
iwindow.setContent(contentArray[i])
iwindow.setPosition(event.latLng)
iwindow.open(map);
}
});
}
although presumably your markerArray length will be greater than the
number of markerClusters you have, which may explain the undefined
thing - I don't know if you can do something like for (var i = 0; i <
markerClusters.length; i++){ but I see that there is a
getTotalClusters() method - If I understand what you are trying to
do, maybe you should use that?