title: Dynamic content in google maps api v3 info windows on multiple custom markers
body: <p>I have the below js that implements a google map with a looped through set of custom markers. I need each marker to have a different infowindow so when you click the marker you get the content that is relevant. At the minute it doesn't open the infowindow and doesn't give me an error in console</p>
  
  <pre><code>infowindow = new google.maps.InfoWindow();
  
      for(var i=0; i&lt;google_map_item.length; i++)
      {
          latlon = new google.maps.LatLng(google_map_item[i].lat, google_map_item[i].lon)
          bounds.extend(latlon);
          var iconcolor = google_map_item[i].iconColor;
          marker = new google.maps.Marker({
              map: map,
              position: latlon,
              icon: "https://chart.googleapis.com/chart?chst=d_map_pin_letter_withshadow&amp;chld=" + (i + 1) + "|"+iconcolor+"|000000",
              type: 'flat',
              icon_color: '#ff0000', 
              label_color: '#ffffff', 
              width: '20', 
              height: '20', 
              label_size: '11',
                              clickable: true
          });
  
                      google.maps.event.addListener(marker, 'click', function() {
                          //marker.info.open(map, this);
                          infowindow.setContent(this.latlon);
                          infowindow.open(map, this);
                      });
  
  
          map.fitBounds(bounds);
      }
  </code></pre>