Created
July 13, 2010 06:20
-
-
Save mbklein/473516 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}) | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've tried to incorporate this into a project that I am using and could use a little help. Do you have a working version of this or could I pass you my source code and have you take a peek?
Thanks.