-2

How to Pass LatLng Values for the Origin/Destination parameter in the request parameter of Directions API by Google.

Visit this link: Google map driving direction source code for their example?

  var request = {
   origin: 'Chicago', // Here I want to add a latitude and Longitude value 
   destination: 'New York',
   travelMode: google.maps.DirectionsTravelMode.DRIVING
  };
Community
  • 1
  • 1
Tigga
  • 13
  • 1
  • 8
  • Use a [google.maps.LatLng](https://developers.google.com/maps/documentation/javascript/reference#DirectionsRequest) as specified in the documentation. – geocodezip Feb 17 '14 at 20:51

1 Answers1

1

You should just be able to use a new Google lat/lng pair. For example:

origin: new google.maps.LatLng(51.2244, -12.12221)
Andy
  • 61,948
  • 13
  • 68
  • 95