Irina_hines,
а так?
function calcRoute2() {
var start = calcRoute();
$.ajax({
type: "POST",
url: "index.php",
dataType: "text",
data: "param=" + calcRoute(),
success: function(data) {
var request = {
origin: start,
destination: data,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) directionsDisplay.setDirections(response)
})
}
})
};