Try this:
google.maps.event.addListener(map, "click", function(event) {
infowindow.close();
});
It is quite simple an should work as well.
Try this:
google.maps.event.addListener(map, "click", function(event) {
infowindow.close();
});
It is quite simple an should work as well.