using multi-markers with multi info-windows
- by mohsen
I have an array of info-windows corresponding to an array of markers.
Now, I have a problem, I use the below code to generate an info-window, when clicking on the marker all the markers disappear unless one, also when I click on that marker there is no info-window come out.
What is the wrong with my code ? or what shall I do ?
Any answer will be very appreciated, Thanks in advance.
This code is inside a for loop:
infoWindoArray[i][j] = new google.maps.InfoWindow({
content:"Lat: "+this.position.lat() + "\nLng: " + this.position.lng() + "\n"+ this.customInfo,
});
google.maps.event.addListener(AllMarkers[i][j], 'click', (function(x) {
return function() {infoWindoArray[i][j].open(map,AllMarkers[i][j]);}
})(x));