Search code examples
google-mapsdirectionslimits

Bypass Google Maps Directions limits


I've to make a map with multiple directions but the API limit 10 directions by map. So how can I bypass this? Is there any paying way to increase the limits?

Thanks in advance


Solution

  • So, Google limit to 10 request per second so when I get the OVER_QUERY_LIMIT error code. I wait 1 sec and I redo the request.

    I've found this function:

    function sleep(milliseconds) {
      var start = new Date().getTime();
      for (var i = 0; i < 1e7; i++) {
        if ((new Date().getTime() - start) > milliseconds){
          break;
        }
      }
    }