title: How to delete an infowindow bound with a marker?
body: <p>I wrote a chunk of Google Maps API code follow <a href="https://stackoverflow.com/q/2947371/784005">this</a> idea.</p>
  
  <p>But, when I delete all markers, the infowindows bound to these markers are not deleted.</p>
  
  <p>Can anyone show me the solution?</p>
  
  <p>Thanks.</p>
  
  <p>This is how I delete the markers:</p>
  
  <pre><code>// Deletes all markers in the array by removing references to them
  function deleteOverlays() {
    if (markersArray) {
      for (i in markersArray) {
        markersArray[i].setMap(null);
      }
      markersArray.length = 0;
    }
  }
  </code></pre>
  
  <p><code>markersArray</code> is a global var which stores all the markers.</p>
  
  <p>I declared the infowindows like this:</p>
  
  <pre><code>marker.infowindow = new google.maps.InfoWindow(
          {
              content: '&lt;div&gt;something here&lt;/div&gt;'
          });
  </code></pre>