Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function calculateAndDisplayRoute(directionsService, directionsDisplay) {
  2.  
  3. directionsService.route({
  4. origin: {lat: 37.77, lng: -122.447},
  5. destination: {lat: 37.768, lng: -122.511},
  6.  
  7. travelMode: google.maps.TravelMode.WALKING
  8. }, function(response, status) {
  9. if (status == google.maps.DirectionsStatus.OK) {
  10. directionsDisplay.setDirections(response);
  11. console.log(response);
  12. } else {
  13. window.alert('Directions request failed due to ' + status);
  14. }
  15. });
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement