Related Tags:
JQuery JQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. Learn More, JavaScript Javascript is an object-oriented computer programming language commonly used to create interactive effects within web browsers. Learn More, Distance Matrix API The Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations, based on the recommended route between start and end points. Learn More,

google's distance matrix api throwing MAX_DIMENSION_EXCEEDED exception

Description:I have used google distance matrix api to calculate road distances from my place to some near by places it was working fine when I have tested the code but when we have increased the number of records it has started giving the "MAX_DIMENSION_EXCEEDED" exception it seems that one can't calculate more distances as I have nearly 200 destination in total for which I have to calculate distances need help.

Posted by: | Posted on: May 09, 2019

1 answers

Replies

2

Hi umer,
There is some limitations when you are using google distance matrix api and for complete details you can read this. and for your concerned part following are some point that are effecting your code.

-Maximum of 25 origins or 25 destinations per request.
-Maximum 100 elements per server-side request.
-Maximum 100 elements per client-side request.
-1000 elements per second (EPS), calculated as the sum of client-side and server-side queries.


So what you have do is break your destinations into chucks of 25 destinations per request once your destinations count reaches to 100 then for further requests you have to wait for 2 seconds only then you will be able to fetch distance for next 100 destinations.

Replied by: | Replied on: May 24, 2019



Reply
×

Code block Hyperlink bold Quotes block Upload Images

Preview