title: Google Maps 3 : when any marker clicked same infoWindow opens up
body: <p>I have several markers on my google map. Each has text that should show when it is clicked in the form of an infowindow. The code for all this is below. Hwever, the problem is that, when I click any marker on the map, its always the same marker that the map zooms in on and the same marker's infoWindow pops up. No matter where I click its always the same. </p>
  
  <p>Wondering if there is something in plain sight that Im doing wrong. Could someone give me some advice?</p>
  
  <pre><code>  function getlistings()  
     {  
       $.getJSON('list/listings.json', processlistings);  
     }  
  
  
  
  function processlistings(data)   
  {  
      listings = data;  
      markersArray = [];  
      for( i = 0; i &lt; listings.length; i++)   
      {  
          var listing = listings[i];  
          var markerLatLng = new google.maps.LatLng(parseFloat(listing["latitude"]), parseFloat(listing["longitude"]));  
          marker = new google.maps.Marker({  
              position : markerLatLng,  
              title: listing['name'],  
              map : map  
          });  
  
      var infowindow = new google.maps.InfoWindow(  
          {  
            content: listing['name'],  
            position: markerLatLng  
          });  
  
      google.maps.event.addListener(marker, 'click', function()   
      {  
          infowindow.open(map);  
  
      });  
  
      markersArray.push(marker);  
  }  
  </code></pre>
  
  <p>}  </p>