Does someone know how to modify this code so that google maps closes infowindows when you open another? In other words, I want only one infowindow open at all times. I looked around on stackoverflow but couldn’t seem to implement people’s solutions in this code. Answer There is a google recommendation what to do if you only want one InfoWindow