google-maps - 使用电子表格中的 API 密钥进行身份验证
问题描述
我在 Google 表格中有代码,它使用 Google Maps API 来计算两个位置之间的距离。我有一个 Google API 密钥,但不知道如何将它插入到我的代码中进行身份验证。我没有客户 ID。有人可以帮忙吗?
function DISTANCE(origin, destination) {
var directions = Maps.newDirectionFinder()
.setOrigin(origin)
.setDestination(destination)
.getDirections();
return directions.routes[0].legs[0].distance.value;
}
解决方案
推荐阅读
- swift - 在绘图应用程序(例如 Sketch)中指定具有角半径的 UIBezierPath 点
- python - 从其他项目排队芹菜任务
- oracle-apex - 顶点不安装
- php - PHP:将“水平”列出的数组转换为具有其他结构的数组
- multiprocessing - 如何并行初始化 PYFMI 模型?
- elasticsearch - Logstash 错误:无法从 :jdbc_driver_library 加载 mysql-connector-java-,没有要加载的文件 -- mysql-connector-java-
- javascript - 如何在反应中添加两个值?
- java - 如何为 Dockerized SpringBoot REST jar 执行指定 JVM 参数列表
- python - Python,覆盖继承方法的功能
- kotlin-js - 如何更改 KotlinJS 的默认端口号