30
Views
1
Comments
[Google Distance Matrix API] Find the nearest local office
Question
google-distance-matrix-api
Service icon
Forge asset by www.justsolve.co.za

We are writing an app that will link a potential customer to an office nearest to their location.  The company has several hundreds of locations, perhaps thousands.  Can this app determine their location and find the nearest office to their location?  Thanks.

UserImage.jpg
Botha van der Vyver

Hi Brian,

What you will need to do is to build the logic of iterating through these offices yourself. Maybe use a radius function to narrow down the top 10 nearest offices first and then loop through the top 10 calling the distance api to see which one is nearest.

*Key note: Do you want to determine nearest office as line of sight or driving distance? If driving distance then use this app otherwise just filter on the co-ordinates with a radius function and order them in distance.

To link  a customer to an office nearest to them will work great with this app. 

You will not be using the traffic information though.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.