title: Open InfoWindow for each polygon google maps V3
body: <p>Hope someone can help me with this issue.
  I'm trying to open an info windows on click for each polygon that my users created. 
  I used the same code for a marker and works well but i couldn't make it work for each polygon.</p>
  
  <p>Any thoughts on how to solve this problem?</p>
  
  <pre><code>var contentString = '&lt;div id="content"&gt;'+
      '&lt;div id="siteNotice"&gt;'+
      '&lt;/div&gt;'+
      '&lt;h2&gt;Test&lt;/h2&gt;'+
      '&lt;/div&gt;';
  
  var infowindow = new google.maps.InfoWindow({
      content: contentString
  });
  </code></pre>
  
  <p>// Show Areas</p>
  
  <pre><code>&lt;?php foreach ($field-&gt;result() as $f):?&gt;
  
  // Create an array with the coordanates of each area
  
  var field&lt;?=$f-&gt;id?&gt;Coords = [
      &lt;?php $latlng=$this-&gt;resources_data-&gt;field_latlng($f-&gt;id);?&gt;
      &lt;?php foreach ($latlng-&gt;result() as $point):?&gt;
      new google.maps.LatLng(&lt;?=$point-&gt;lat?&gt;, &lt;?=$point-&gt;lng?&gt;),
      &lt;?php endforeach;?&gt;
  ];
  
  // Create a polygon with the points of the area
  
  var area&lt;?=$f-&gt;id?&gt;=new google.maps.Polygon({
      paths: area&lt;?=$f-&gt;id?&gt;Coords,
      strokeColor: '#FF0000',
      strokeOpacity: 0.8,
      strokeWeight: 2,
      fillColor: '#FF0000',
      fillOpacity: 0.35
  });
  
  // Add the area to the map.
  
  area&lt;?=$f-&gt;id?&gt;.setMap(map);
  
  google.maps.event.addListener(area&lt;?=$f-&gt;id?&gt;,'click',function(){
      infowindow.open(map,area&lt;?=$f-&gt;id?&gt;)
  });
  
  &lt;?php endforeach;?&gt;
  </code></pre>