Skip to content

Instantly share code, notes, and snippets.

@GregoryCollett
Created January 3, 2015 11:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GregoryCollett/c8e3599f6170127a8159 to your computer and use it in GitHub Desktop.
Save GregoryCollett/c8e3599f6170127a8159 to your computer and use it in GitHub Desktop.
// from and to are objects that live somewhere else (for examples sake)
uiGmapGoogleMapApi.then(function(maps){
var directionsService = new maps.DirectionsService();
var request = {
origin: new maps.LatLng(
from.lat(),
from.lng()
),
destination: new maps.LatLng(
to.lat(),
to.lng()
),
travelMode: maps.TravelMode['DRIVING'],
optimizeWaypoints: true
};
directionsService.route(request, function(response, status) {
//do stuff here with response
});
});
@lakhansamani
Copy link

What is the ui code that you have written for this?

@codedcontainer
Copy link

Says that from is not defined.

@Jp3292
Copy link

Jp3292 commented Apr 25, 2017

how to display direction root in one string?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment