title: Multiple Markers on Google Map: only last marker is shown
body: <p>I am having a problem with displaying multiple markers on my map. The code starts by looping through an array, and then reverse geocoding the lat, lon values before displaying a marker and setting the content of the infoWindow to the returned address.</p>
  
  <p>My codes are below.</p>
  
  <pre><code>for(var i=0; i &lt; useNowArray.length; i++) {
          // plot useNow on map
          latlng = new google.maps.LatLng(useNowArray[i]['lat'], useNowArray[i]['lon']);
          console.log(useNowArray[i]['lat'] + useNowArray[i]['lon']);
          geocoder.geocode({'latLng': latlng}, function(results, status) 
          {
              if (status == google.maps.GeocoderStatus.OK) 
              {
                  if (results[0]) 
                  {
                      marker = new google.maps.Marker({
                          position: latlng,
                          map: map,
                          icon: 'http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png',
                          title: results[0].formatted_address
                      });
                      content = results[0].formatted_address;
                      console.log(content);
  
                      google.maps.event.addListener(marker, 'click', (function(marker, i) {
                          return function() {
                              infowindow.setContent(content);
                              infowindow.open(map, this);
                          }
                      })(marker, i));
                  }
              } else {
                  alert("Geocoder failed due to: " + status);
              }
          }); // end geocode function
      }  
      var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); 
  </code></pre>
  
  <p>The issue is that only my last marker is shown. </p>
  
  <p>What am i missing? :(</p>
  
  <p>many thanks.</p>