【发布时间】:2021-09-26 09:41:59
【问题描述】:
我使用自定义函数:
if (!address) {
throw new Error("No address specified!");
}
if (address.map) {
return address.map(LATLONG);
}
const key = ["address", address].join(",");
const value = getCache(key);
if (value !== null) return value;
const { results: [data = null] = [] } = Maps.newGeocoder().geocode(address);
if (data === null) {
throw new Error("Address not found!");
}
const { formatted_address } = data;
setCache(key, formatted_address);
return formatted_address;
};
在超过 2000 行的整列中应用函数=GOOGLEMAPS_ADDRESS(B59) 后,gs 服务器关闭,出现错误异常:一天内调用了太多次服务:地理编码。 (第 71 行)。这不是因为地址不对,而是因为请求发生在每次移动行,删除或添加之后。在这张图片上显示了一些单元格获得了价值,但主要是错误。 https://i.stack.imgur.com/YSoRQ.png
如何将获得的值存储在活动单元格中,并在值将存储在那里之后从活动单元格中删除自定义函数?
【问题讨论】:
-
请看this
-
请提供对您电子表格的访问权限(从中删除机密数据)。
-
好的,试试这个,这是简化版:docs.google.com/spreadsheets/d/…
-
@Muhammet Yunus Tunca,有很好的科目审查,但这不完全是我的情况。
标签: google-apps-script geocode