function calcRoute() {
var start = document.getElementById("start_").value;
var end = document.getElementById("end_").value;
var request = {
origin: start,
destination: end,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function (response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}
在 Chrome 中给出错误消息:“未捕获的 TypeError:无法调用未定义的方法 'setDirections'”。有人可以建议解决这个问题吗?谢谢