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); } }); }
Provides an error message in Chrome: "Uncaught TypeError: Unable to call setDirections method from undefined". Can anyone suggest a fix for this? thanks
kamal
source share