title: Google maps: API 3, how to set polyline in the center
body: <p>Hi all I need to be able to center the polyline in the center of the map</p>
  
  <p>Only the necessery part of the code...</p>
  
  <pre><code>success: function(data) {//callback to be executed when the response has been received
  
      data = JSON.parse(data);
      for (var i=0;i&lt;data.length;i++) {
          flightPlanCoordinates[i] = new google.maps.LatLng(data[i].x,data[i].y);
      }
      map = new google.maps.Map(document.getElementById("map_find"),
      mapOptions);
      flightPath = new google.maps.Polyline({
              path: flightPlanCoordinates,
              strokeColor: "#8a2be2",
              strokeOpacity: 1.0,
              strokeWeight: 3
      });
  
      flightPath.setMap(map);
      map.setZoom(5);
      map.setCenter(flightPlanCoordinates);
  }
  </code></pre>
  
  <p>This is not doing what I need..My map is not centered and not zoomed, how to achieve this?</p>