Google Maps API永远不会满足



如果我将URL引用身份验证与地理编码API一起使用,它会说:

There was an error while trying to fix the Venues geolocation information: API keys with referer restrictions cannot be used with this API.

经过研究,我发现这意味着谷歌地图正在寻找IP地址身份验证。

但是,如果我使用Javascript Maps API的IP地址身份验证,它会说:

JavaScript API error: RefererNotAllowedMapError

https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error 要授权的网站网址:https://example.com

这是怎么回事?

我怎样才能完全满足好的谷歌地图?

看起来您正在使用两个不同的地图 API:客户端 JavaScript API 和服务器端地理编码 API Web 服务。这意味着您需要 2 个 API 密钥;一个受客户端使用的 HTTP 引用程序限制,另一个仅受 Web 服务的 IP 地址限制。

要详细了解 API 密钥限制的工作原理,请参阅 Google 关于 API 密钥最佳做法的文档。

希望这有帮助!

我知道这已经 3 个月大了。但是我遇到了同样的问题,我找到了解决这个问题的方法。

正如 evan 所说,您需要 2 个 API 密钥。令人讨厌的是,事件日历只有一个API密钥字段。 但是,我在这里找到了一个链接:https://support.theeventscalendar.com/https://support.theeventscalendar.com/716190-Using-Google-Maps-API-Key-Restrictions。该页面重定向...但是我设法在重定向之前截屏了它的一部分,并找到了这个片段:https://gist.github.com/cliffordp/a2ec320313afbc1ffb5f0e5ac654b7fb (我更改了代码以使用定义,因为我不希望我的 API 密钥在 git 中(

此过滤器将有可能拥有两个 API 密钥。

最新更新