title: infowindow opens at same marker!
body: <p>ok well , i have this code which is called for every position i fetch from a DB, the thing is that whenever i click on a marker the infowindow is shown with the respective marker information , but the position of the infowindow is always avobe the last marker added , in a nut shell info is fine but its not showed where it should be. </p>
  
  <p>these two are declared when the map its initialized and are global.</p>
  
  <pre><code>var infowindow = new google.maps.InfoWindow();
  var geocoder=new google.maps.Geocoder
  </code></pre>
  
  <p>this is the script</p>
  
  <pre><code>function addRoleMarker(lat,lng,rumbo,codigo,velocidad,nE,referer,utc,fecha)
  {
   var myLatLng = new google.maps.LatLng(lat, lng);
  var title='No.'+nE+' '+utc;
  
  baseMarker = new google.maps.Marker({
          position: myLatLng,
          map: map,
      title: title,
      zIndex: 1
      });
  
      google.maps.event.addListener(baseMarker,'click',function(){
              geocoder.geocode({'latLng': myLatLng}, function(results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  if (results[0]) {
                  switch(rumbo)
                  {
                  case 0:
                  rumbo='N';
                  break;  
                  case 1:
                  rumbo='NE';
                  break;
                  case 2:
                  rumbo='E';
                  break;
                  case 3:
                  rumbo='SE';
                  break;
                  case 4:
                  rumbo='S';
                  break;
                  case 5:
                  rumbo='SO';
                  break;
                  case 6: 
                  rumbo='O';
                  break;
                  case 7:
                  rumbo='NO';
                  break;
                  }
  
              var tablaR="&lt;table&gt;&lt;tr&gt;&lt;td&gt;Fecha:&lt;/td&gt;&lt;/tr&gt;&lt;td&gt;"+fecha;
              tablaR+="&lt;/td&gt;&lt;tr&gt;&lt;td&gt;Fecha UTC:&lt;/td&gt;&lt;/tr&gt;&lt;td&gt;"+utc;
              tablaR+="&lt;/td&gt;&lt;tr&gt;&lt;td&gt;Velocidad:&lt;/td&gt;&lt;/tr&gt;&lt;td&gt;"+velocidad;
              tablaR+="&lt;/td&gt;&lt;tr&gt;&lt;td&gt;Rumbo:&lt;/td&gt;&lt;/tr&gt;&lt;td&gt;"+rumbo;
              tablaR+="&lt;/td&gt;&lt;tr&gt;&lt;td&gt;Direccion:&lt;/td&gt;&lt;/tr&gt;&lt;td&gt;"+results[0].formatted_address;
              infowindow.setContent(tablaR);
              infowindow.open(map,baseMarker);
                  }else{
                    alert("No results found");
                  }
              }else{
                  alert("Geocoder failed due to: " + status);
                }});});
  }
  </code></pre>
  
  <p>the number of markers depends on the data fetched acording to a sql query this is the php script </p>
  
  <pre><code>&lt;?
  $script="&lt;script type='text/javascript'&gt;";
  
      for($i=0;$i&lt;count($losDatos);$i++)
      {
      $script.="addRoleMarker(".$losDatos[$i]['latitud'].",".$losDatos[$i]['longitud'].",".$losDatos[$i]['rumbo'].",".$losDatos[$i]['codigo'].",".$losDatos[$i]['velocidad'].",".$losDatos[$i]['numeroEconomico'].",1,'".$losDatos[$i]['utcDate']."','".$losDatos[$i]['localDate']."');";
      }
  
  $script.='&lt;/script&gt;';
  echo $script;
  ?&gt;
  </code></pre>