title: google maps close marker when click on map
body: <p>I spent my whole day trying to figure out, what am I doing wrong.</p>
  
  <p>I have a google map and after a user search, several markers appear on the map. Every marker when clicked pops an infobox. I used infobubble.js for that. Every bubble has a close button that works perfectly. The thing i want to do is when I click the map, the open infobubble to be closed.</p>
  
  <p>A small fragment of my code is like this
  For every marker</p>
  
  <pre><code>var marker = new google.maps.Marker({
              map: map,
              position: point,
              icon: icon.icon,
              shadow: icon.shadow
            });  
  
   google.maps.event.addDomListener(map,'click',func(){
                infoWindow.close();
  });
  
  
            bindInfoWindow(marker, map, ib,html);
  </code></pre>
  
  <p>one of my tries is this code. I tried several things but nothing worked.</p>
  
  <p>Thanks</p>