title: Google map, multiple physical addresses, multiple pointer icons, same icon shows all the time
body: <p>I need help with Google maps. I want to create a map where I could show multiple addresses using multiple pointers. Poblem is that the last address' pointer icon displays for all addresses. It has probably something to do with the asynchronous geocoder.geocode, but I'm a JS beginner and I'm not able to solve this problem. </p>
  
  <p>Can anyone help please? Thanks.</p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; 
      &lt;script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt; 
  &lt;body&gt;
  &lt;div id="map" style="width: 500px; height: 500px;"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  
  var locations = [
      ['Place A', '2430 N 1060 E, North Logan, UT', 'A'],
      ['Place B', '495 W Jackson Street, Knoxville, IA', 'B'],
      ['Place C', '1900 N Flagler Drive, West Palm Beach, FL', 'C']
  ]; 
  
  
  var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 0,
      center: new google.maps.LatLng(-33.92, 151.25),
      mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  
  
  
  var infowindow = new google.maps.InfoWindow();
  
  var marker, i;
  
  
  for (i = 0; i &lt; locations.length; i++) {  
  
  
      var image = new google.maps.MarkerImage('http://chart.apis.google.com/chart?chst=d_map_pin_letter&amp;chld=' + locations[i][2] + '|FF0000|000000',
          new google.maps.Size(21, 34),
          new google.maps.Point(0,0),
          new google.maps.Point(10, 34)
      );
  
      var geocoder = new google.maps.Geocoder();
      geocoder.geocode( { 
          'address': locations[i][1]
      }, function(results, status){
  
          if (status == google.maps.GeocoderStatus.OK) {
  
               marker = new google.maps.Marker({
                  position: results[0].geometry.location,
                  map: map, 
                  icon: image
              });
          } 
      });
  
  }
  &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>