首页 > 解决方案 > 已超出地图服务的每日配额限制,但未显示已使用配额

问题描述

我有一个包含地点列表的 Google 表格。对于每个地方,我的目标是一次计算它与所有其他地方的距离,目的是找到彼此附近的地方。

getDistance()下面的函数返回一个浮点数,对应于两个地址之间的英里距离:

(我已经修改了我的 API 密钥和客户端 ID)

function getDistance(from, to) {
  var key = '{my-API-key}';
  var clientID = '{my-client-id}';
  Maps.setAuthentication(clientID, key);
  var directions = Maps.newDirectionFinder()
                       .setOrigin(from)
                       .setDestination(to)
                       .setMode(Maps.DirectionFinder.Mode.DRIVING)
                       .getDirections();
  return parseFloat(directions.routes[0].legs[0].distance.text);
};

我尝试过的事情:

这些启用的 API 在 API 控制台中均未显示任何用法,但我的脚本仍然存在以下错误:

一天服务调用次数过多:路由

我没有看到为此设置的任何相关配额,所以我不明白什么?

标签: google-mapsgoogle-apps-scriptgoogle-directions-api

解决方案


推荐阅读