即使为 Google 地图地理定位 API 启用了所有 API,也正在获取 "REQUEST_DENIED"

Getting "REQUEST_DENIED" even though all APIs are enabled for Google Maps Geolocation API

真的很奇怪的问题,我已经尝试找到解决这个问题的问题。

我正在尝试使用 Google 地图 JavaScript API 进行地理定位,就像这个演示:

在我的控制台中,我启用了我认为可能与此相关的任何 API;

我有一个完全不受限制的密钥:

而且我在 HTTP 调用中显然已经替换了 KEY,但我仍然得到;

Geocoding Service: This API project is not authorized to use this API. For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key runner-4.1.7.min.js:1:9002

Google Maps JavaScript API error: InvalidKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error

已启用计费(甚至我的账户上还有钱)。

我可能还错过了什么?

(此外,没有地理定位,只有 javascript 地图 API,一切正常。问题出在地理定位上)

您的密钥没有任何 API 限制,但您可能应用了应用程序限制,控制哪些网站、IP 地址或应用程序可以使用您的 API 密钥。

正确答案:应该是GeodecodingAPI,不是Geolocation.