我有一个纬度和经度:“-27.0000,133.0000”。我想在此基础上制作一张地图。

我试着去这个链接

https://maps.googleapis.com/maps/api/geocode/json?latlng= 27.0000, 133.0000关键= * * * * * *

我一直在浏览器上得到这个错误

{
   "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
   "results" : [],
   "status" : "REQUEST_DENIED"
}

但我想我已经启用了那个API。我登录到我的谷歌控制台,并再次检查。

当我去:https://console.developers.google.com/project/75423435770063/apiui/apis/enabled

我明白了:

启用地理编码+地理定位。

我现在有点卡住了。还有什么我没注意到的吗?


当前回答

如果遇到类似地理编码访问被拒绝的错误:所以你可以从getKey帐户启用地理编码api服务。在这里输入图像描述

其他回答

您忘记在开发人员控制台中启用服务。

Places API和Places SDK for Android是两个不同的API。Android开发者同时启用了这两种功能。这对我很管用!

没有必要启用地理编码和地理定位api,他们有不同的 目的。

对我来说,我必须启用地图嵌入API。

在谷歌云控制台

转到API选项卡,查看其他API部分,并尝试启用任何与地图相关的API。

也可以通过云SDK启用api。https://developers.google.com/maps/documentation/geocoding/cloud-setup#enabling_apis

gcloud services enable \
    --project "PROJECT" \
    "geocoding-backend.googleapis.com"

https://cloud.google.com/sdk/gcloud/reference/services/enable

{"error_message": "此API项目未被授权使用此API。请确保该API已在API控制台中激活:了解更多信息:https://code.google.com/apis/console", "results": [], "status": "REQUEST_DENIED"}

启用方向API使我修正了这个错误

https://console.developers.google.com/apis/library/directions-backend.googleapis.com