Google Maps API : Alternative for google.maps.DistanceMatrixService

64 views
Skip to first unread message

parimal shere

unread,
Nov 4, 2015, 6:26:33 PM11/4/15
to Google Maps JavaScript API v3
I am using google.maps.DistanceMatrixService to get distance between source[] and destination[]. But DistanceMatrixService returns distances between each source and destination.

E.g Source[] = [Source1,Source2,Source3]
Destination[] = [Dest1, Dest2, Dest3]

DistanceMatrixService will returns distance between each source and destination combination.
like [Source1 - Dest1], [Source2 - Dest1], [Source3 - Dest1], [Source1 - Dest2].........[Source3 - Dest3]

Is there any way to get one to one distances rather than each combination. Like [Source1 - Dest1], [Source2 - Dest2], [Source3 - Dest3].

My application is going to use this services heavily, so it causes to exceeds standard usage limits mentioned at
https://developers.google.com/maps/documentation/distance-matrix/usage-limits

So my Questions are
1. Is there any alternative provided by Google Map API for google.maps.DistanceMatrixService?

2. If not, is there any way in the same service to get only one to one distances?

parimal shere

unread,
Nov 4, 2015, 6:26:33 PM11/4/15
to Google Maps JavaScript API v3
I am using google.maps.DistanceMatrixService to get distance between source[] and destination[].
But DistanceMatrixService returns distances between each source and destination.

E.g Source[] = [Source1,Source2,Source3]
Destination[] = [Dest1, Dest2, Dest3]

DistanceMatrixService will returns distance between each source and destination combination.
Like [Source1 - Dest1], [Source2 - Dest1], [Source3 - Dest1], [Source1 - Dest2].........[Source3 - Dest3]

Mark McDonald

unread,
Nov 4, 2015, 6:33:35 PM11/4/15
to Google Maps JavaScript API v3
The other API you can use for 1:1 distances is the Directions API, which returns a superset of the information you get from the Distance Matrix API, but only works for a source, dest pair.



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-a...@googlegroups.com.
To post to this group, send email to google-map...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages