1

Is there a way/method/service/api to calculate the travelling distance between two latitude and longitude points by car?

I need to show the client the distance of his location/zipcode to near most restaurants based on the travel distance chosen by him. For example, if he selects 25 miles then only the restaurants within 25 miles should be displayed.

The latitude and longitude of the restaurants are available. Also the latitude and longitude of the user is available through his pincode based on his acceptance of whether he wants to share his location using the browser he is using.

Is there any available Google service available for it I could use in my JavaScript application?

skip
  • 12,193
  • 32
  • 113
  • 153
  • 1
    [directions service](https://developers.google.com/maps/documentation/javascript/directions), [distance matrix](https://developers.google.com/maps/documentation/javascript/distancematrix) – geocodezip Aug 19 '14 at 20:03

1 Answers1

1

Take a look at Google Places API - it's pretty straightforward - let me know if you have any questions.

https://developers.google.com/maps/documentation/javascript/places

kehphin
  • 149
  • 1
  • 2
  • 11
  • Should I not be using `https://developers.google.com/maps/documentation/javascript/distancematrix`? Only information I have is latitude and longitude of the origin and destination and I somehow want the radius to be set by the client to give him desired results. – skip Aug 19 '14 at 19:29