Thursday, May 05, 2011

Distance Matrix

Distance Matrix service was introduced in the latest update of v3 API. It returns maximum 100 driving distances and durations by a single request. Reference.

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.

This is a useful service.

3 comments:

SEAN said...
This comment has been removed by the author.
SEAN said...

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. :)

Ayesha Sharma said...

very informative.

please have a look into this also.. http://www.etechpulse.com/2014/03/how-to-use-google-distance-matrix.html

Regards,
Ayesha