Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calcRoute() {
- var start = document.getElementById("start").value;
- var end = document.getElementById("end").value;
- var request = {
- origin:start,
- destination:end,
- travelMode: google.maps.DirectionsTravelMode.DRIVING
- };
- directionsService.route(request, function(response, status) {
- if (status == google.maps.DirectionsStatus.OK) {
- directionsDisplay.setDirections(response);
- var route = directionsDisplay.directions.routes[0]
- var request = { 'path' : route.overview_path , 'samples' : Math.min(Math.floor(route.legs[0].distance.value / 500),1024) }
- elevationService.getElevationAlongPath(request, function(result, status) {
- elevationData = result;
- })
- }
- });
- }
Add Comment
Please, Sign In to add comment