title: Google maps api close infowindow when clicking somewhere else
body: <p>I have tried google it but can't find the one to apply to my code. i want my infowindow(s) to close everytime someone presses another place on the map or opens another infowindow somewhere else. </p>
  
  <p>Can someone please help?</p>
  
  <pre><code>var myLatlng = new google.maps.LatLng(val.coords.split(',')[0].trim(),val.coords.split(',')[1].trim());
  
  var infowindow = null;
          var contentString = '&lt;div id="content"&gt;'+
    '&lt;div id="siteNotice"&gt; content'+
    '&lt;/div&gt;';
  
  
          var infowindow1 = new google.maps.InfoWindow({
              content: contentString,
              maxWidth: 250
          });
  
          var marker1 = new google.maps.Marker({
              position: myLatlng,
              map: map,
              icon: image,
          });
  
          google.maps.event.addListener(marker1, 'click', function() {
              infowindow1.open(map,marker1);
          });
  
  
      });
  });
  </code></pre>