Maps.newDirectionFinder()超出每日请求配额 [英] Maps.newDirectionFinder() Exceeded Daily Request Quota

本文介绍了Maps.newDirectionFinder()超出每日请求配额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用嵌入到Google电子表格中的GAS作为里程日志。用户输入起点和终点后,我的脚本会自动计算距离并将其输入到电子表格中。它完美的工作,除了它告诉我的一半时间外:

{error_message =您已经超过了此API的每日请求限额。我们建议您在Google Developers Console上注册一个密钥: https://console.developers .google.com / apis / credentials?project = _ ,routes = [],status = OVER_QUERY_LIMIT}

绝对无法接近每日请求配额。我的代码的相关部分如下:

  var directions = Maps.newDirectionFinder()
.setOrigin(orig )
.setDestination(dest)
.getDirections();

它会在.getDirection()处引发错误。我非常感谢对这个问题的任何见解。

解决方案

按照建议(现在需要)为请求添加一个密钥。

I am using a GAS embedded into a Google spreadsheet to act as a mileage log. After the user enters their origin and destination, my script automatically calculates the distance and inputs it into the spreadsheet. It works perfectly, except half the time it tells me:

{error_message=You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_, routes=[], status=OVER_QUERY_LIMIT}

I am definitely nowhere near the daily request quota. The relevant part of my code is as follows:

var directions = Maps.newDirectionFinder()
    .setOrigin(orig)
    .setDestination(dest)
    .getDirections();

It throws the error at .getDirection(). I would greatly appreciate any insight into this problem.

解决方案

add a key to the request as recommended (it is now required).

这篇关于Maps.newDirectionFinder()超出每日请求配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆