I am working with the Google Maps API and multiple markers. On a marker, there needs to be a click event to open an info window. I got that part working. I was wondering if there was a way to pass multiple variables and add the same event listener on all those markers?
I currently have:
google.maps.event.addListener(marker, 'click', function () {
_(that.popups).each(function (popup) {
popup.hide();
}).value();
infowindow.show(/*that.map, marker*/);
});
If I have a nyMarker variable, then a laMarker variable, how do I pass on this to the event handler?