using multi-markers with multi info-windows
Posted
by
mohsen
on Stack Overflow
See other posts from Stack Overflow
or by mohsen
Published on 2013-06-29T04:14:42Z
Indexed on
2013/06/29
4:21 UTC
Read the original article
Hit count: 230
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));
© Stack Overflow or respective owner