52
rated 0 times
[
53]
[
1]
/ answers: 1 / hits: 24862
/ 12 Years ago, fri, april 20, 2012, 12:00:00
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);
}
});
}
Gives an error message in Chrome:
Uncaught TypeError: Cannot call method 'setDirections' of undefined
Could anyone suggest fixing this?
More From » google-maps-api-3