大家好,我需要能够将折线居中在地图的中心
只有代码的必要部分......
success: function(data) {//callback to be executed when the response has been received
data = JSON.parse(data);
for (var i=0;i<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);
}
这不是我需要的。我的地图没有居中也没有缩放,如何实现这一点?