views:

1047

answers:

1

Hey guys,

I have a website where "near locations" are shown for each item, based on the latitude and longitude coordinates stored in a database.

Problem is that this calculated distance is the air-line distance, which differs a lot ferom the actual driving distance.

Google Maps does only have a JavaScript API for driving directions by now, I need it as a web service API to make calls directly from the server.

Is there any possibility to do this?

A: 

The Google Maps API has a HTTP service for geocoding, but not for directions. You can only access that functionality through the Javascript API. You could hack it, but it would break Google's ToS.

More discussion here.

Chris B
Thanks. I think I will not do it by "hacking"/using the raw HTTP requests. Looping through my items, calculating the distance via the JavaScript API and writing the results back in my database seems to be a good solution for now.
Alex