Car*_*cia 9 google-maps google-maps-api-3 google-apps-script
我们目前正在开始使用google-apps-script和Google Apps.我一直在Stack Overflow中搜索和搜索,试图解决这个问题:
我们有一个Google电子表格,我们在其中计算路线中不同点之间的总距离.像这样的东西:
在我的Apps脚本中,我有这段代码:
var directionFinder = Maps.newDirectionFinder();
directionFinder.setMode(Maps.DirectionFinder.Mode.DRIVING);
directionFinder.setOrigin(origin);
directionFinder.setDestination(destination);
Run Code Online (Sandbox Code Playgroud)
我运行该功能,有时工作,有时不工作.令我恼火的是,当我进入我的Google云端控制台时,在我的API管理中,我没有看到任何API使用情况 - 即使我启用了API,也没有发生任何事情.
我知道我的问题与这些链接完全相同:
Maps.newDirectionFinder()超过每日请求配额
在此链接中,我不明白如何将我的API添加到请求中,如错误信息建议.
在脚本编辑器中设置Maps API密钥
在这个中,代码对我有用,我在API管理员中看到了移动.
问题是,是否可以使用该Maps
方法而不使用UrlfetchApp
?目前使用Maps
,我没有看到任何发生的事情,它可以随时工作.
我看到有一种方法Maps
,例如:
Maps.setAuthentication(clientId, signingKey)
Run Code Online (Sandbox Code Playgroud)
我试着把我的projectId
和API密钥放在这里,但我认为它没有做任何事情.