Question

I am trying to get a driving distance to display next to my search results for a user database that I have collected the lat/long coordinates for. I have found some examples that offer a ‘straight’ line approach, but not really the result I am looking for. A little more background, I have several employees located around me, and I am trying to match their location to the customer’s location easily, so the distance results will change regularly. I am programming in PHP.

Was it helpful?

Solution

You'll want to research reverse geocoding APIs (such as this one) to turn the coordinates back to an address (which most directions based routing APIs like to have) as well as routing APIs (such as this driving directions API).

As far as making all of the requests and utilizing these APIs - you can perform these tasks using php and cURL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top