I have the following code to open an infowindow when a specific marker is click and it open a window. Does anyone know how to close the previous infowindow when another one is clicked?.
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map1, marker);
});
Just make sure you only create ONE
infoWindowin the global scope, like this:UPDATE: