title: google maps middle of a polyline (centroid?)
body: <p>I have a list of polylines, just like google maps <a href="http://maps.google.cz/maps/ms?msa=0&amp;msid=103785062234500484337.00047d6fd24bb4a0a83f2&amp;cd=2&amp;sll=50.389622,12.768141&amp;sspn=0071946,0.071946&amp;hl=cs&amp;ie=UTF8&amp;t=h&amp;ll=50.40808,12.821045&amp;spn=0.153163,0.291824&amp;z=11&amp;source=embed" rel="noreferrer">does</a> when I click on the polyline I want an infowindow to show up just where I clicked, and it works just fine with this function</p>
  
  <pre><code>function mapsInfoWindow(polyline, content) {
      google.maps.event.addListener(polyline, 'click', function(event) {            
          infowindow.content = content;
          infowindow.position = event.latLng;
          infowindow.open(map);
      });
  }
  </code></pre>
  
  <p>the problem comes when I click on the list(using the same function for that), <strong>event</strong> obviously doesn't have the <strong>latLng</strong>, but I'd like infowindow to show up in the middle of the polyline anyway, just like it does when you click on the list in the google maps link <a href="http://maps.google.cz/maps/ms?msa=0&amp;msid=103785062234500484337.00047d6fd24bb4a0a83f2&amp;cd=2&amp;sll=50.389622,12.768141&amp;sspn=0071946,0.071946&amp;hl=cs&amp;ie=UTF8&amp;t=h&amp;ll=50.40808,12.821045&amp;spn=0.153163,0.291824&amp;z=11&amp;source=embed" rel="noreferrer">I mentioned before</a>.</p>
  
  <p>Tried LatLngBounds(); but that gives the actuall center of the area the polylines create, not the middle I need.</p>
  
  <p>Any idea how to do it?</p>