Wednesday, July 25, 2012

Google Maps API multiple markers and infowindows

I was having trouble with binding InfoWindows to markers. No matter which marker was clicked, the InfoWindow for the last marker to be created was displayed.  I found the answer to the problem here:

Simply creating a separate function to add the event listener solved the problem.