gpt4 book ai didi

google-maps-api-3 - 谷歌距离矩阵 API

转载 作者:行者123 更新时间:2023-12-04 07:44:05 37 4
gpt4 key购买 nike

我试图使用 Google Distance Matrix API JSON在我的项目中,格式化 url 后,例如:

http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&mode=bicycling&language=en&sensor=false

我能够在浏览器中查看结果,但是当我尝试发出 http 请求以获取结果时,我将收到状态:REQUEST_DENIED

在文档中:

REQUEST_DENIED indicates that the service denied use of the Distance Matrix service by your application.



但是我仍然不知道为什么我的请求被拒绝了。来自谷歌的更多信息:

Use of the Distance Matrix API must relate to the display of information on a Google Map; for example, to determine origin-destination pairs that fall within a specific driving time from one another, before requesting and displaying those destinations on a map. Use of the service in an application that doesn't display a Google map is prohibited.



如果我不能得到结果,我该如何在谷歌地图上应用它?
有同样问题的人吗?我稍后会发布示例代码,以更清楚地阐明我的问题。

最佳答案

我有一个类似的问题,但这是由于假设传感器标签默认为 false,但实际上是必需的。

关于google-maps-api-3 - 谷歌距离矩阵 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6088952/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com