title: Google Maps V3 geocoding and markers in loop
body: <p>I have some problems with my code, I have a list of airports in a sql database, and I want to create markers for each 1 of those airports.</p>
  
  <p>For the address i got ICAO-codes for each airport, an ICAO is unique for each airport</p>
  
  <p>I get the data from the Database as array</p>
  
  <p>it's is saved in "temp" with an split function and with the for-loop it get them 1 by 1 </p>
  
  <p>Geocoding is not the problem, but I don't know why for the TITLE and the on click event
  it is always the last one from the array which is used.</p>
  
  <p>here is the page, the last entry in the database is ZBAA.</p>
  
  <p>And all the markers are placed at the correct location but the title is wrong :s</p>
  
  <p><a href="http://mizar.lte.lu/~pr1011_meteo/projet/cartemonde4.php" rel="nofollow">http://mizar.lte.lu/~pr1011_meteo/projet/cartemonde4.php</a></p>
  
  <p>The problem is with "address" i think but i m not sure.</p>
  
  <pre><code>for (var i = 0; i &lt; temp.length; ++i){
  
       var address=temp[i];
  
       geocoder.geocode({ 'address': address}, function(results){            
            var marker  = new google.maps.Marker({
                map: map, 
                position: results[0].geometry.location,
                title:address
            });
  
            google.maps.event.addListener(marker, 'click', function() {
                 window.open ('infomonde.php?icao='+address+'&amp;language=fr', 'Informations météo', config='height=400, width=850, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')});
       });  
  };
  </code></pre>