Thursday, May 05, 2011

Distance Matrix

All of you who have a store locator, can now add true driving distances and estimated driving times in search results. Also you can filter out results that exceed a distance limit. If user searches by 100 km radius, you may want to return only results that have a true driving distance less than 100 km.

It is like driving directions without directions. Some people have tried to implement something similar by making multiple driving distance requests. Many of them faced problems with the asynchronous responses not coming back in the same order that requests were made. The new service is very simple to use.

It has travelMode option too. So it can be used for walking distances in city maps.

3 comments:

It's good that this service exists, though it would also be possible to make multiple requests and track them using a semaphore. Once the semaphore reaches zero, the responses should all be received from Google, and then it would be ok to process them. Although admittedly, this is no longer necessary, as you have already pointed out. :)