angular 2 google maps错误RefererNotAllowedMapError

问题描述 投票:0回答:1

尝试将谷歌地图连接到我的应用程序并出现该错误:

Google Maps API错误:RefererNotAllowedMapError

您要授权的网站网址

我所做的 ?

我创建api密钥并将其复制到我的应用程序中。我添加谷歌API和我的IP到HTPP凭证,如下所示:

*.localhost:4200/*

http://localhost/

*.localhost:4200/

*.localhost:4200/

localhost:4200/*

还有很多其他的。

angular maps
1个回答
1
投票

我也有这个问题,我已经解决了这个问题,将apiKey留空,你的代码应该是这样的

AgmCoreModule.forRoot({
      apiKey: ''
    })

并确保为您的项目启用Google Maps API。

© www.soinside.com 2019 - 2024. All rights reserved.