Guest User

Untitled

a guest
May 23rd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function calcRoute() {
  2. var start = document.getElementById("start").value;
  3. var end = document.getElementById("end").value;
  4. var request = {
  5. origin:start,
  6. destination:end,
  7. travelMode: google.maps.DirectionsTravelMode.DRIVING
  8. };
  9. directionsService.route(request, function(response, status) {
  10. if (status == google.maps.DirectionsStatus.OK) {
  11. directionsDisplay.setDirections(response);
  12. var route = directionsDisplay.directions.routes[0]
  13. var request = { 'path' : route.overview_path , 'samples' : Math.min(Math.floor(route.legs[0].distance.value / 500),1024) }
  14. elevationService.getElevationAlongPath(request, function(result, status) {
  15. elevationData = result;
  16. })
  17. }
  18. });
  19. }
Add Comment
Please, Sign In to add comment