api - Google Maps : Platform rejected your request.此I [...]网站或无权使用此API key

标签 api maps embed

<iframe width="100%" height="427" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=place_id:[place_id]&key=[my_key]" allowfullscreen></iframe>

“Google Maps Platform拒绝了您的请求。该IP,站点或移动应用程序无权使用此API key 。收到的请求来自IP地址xxx.xxx.xxx.xxx,引用为https://xxx.xxx/

在Google Dev中,我启用了Maps Embed API,还启用了Maps Static API。我已将 key 限制为只能与我的域一起使用,其中包括上述代码,例如https://[asterisk].thedomain.com/[asterisk]

当我不将 key 限制为单个域时,该 map 嵌入将起作用,并且不会引发错误。

问题是, key 在代码中是可读的,因此我需要将 key 限制在我的域内。

有任何想法吗?

谢谢你。

最佳答案

我有问题的网站像https://thedomain.com/一样交付。

Google Maps Platform确实使https://www.thedomain.com/https://thedomain.com/有所不同。

将我的API限制为https://thedomain.com/*对我有用,而https://*.thedomain.com/*并不表示*无效。

关于api - Google Maps : Platform rejected your request.此I [...]网站或无权使用此API key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50537461/

相关文章:

node.js - Node (Express) - 通过 api 使用 express 发送 pdf

java - 循环遍历n张 map

database - 哪个 node.js 嵌入了具有基于浏览器的控制台的数据库来查看数据

api - Zapier 有 "Meta-API"吗?

node.js - 测试 API 包装器

icons - 带有反应传单的自定义标记图标

javascript - 如何使 Google Maps API (.js) 文件成为移动设备小部件的一部分

Python Tkinter : Embed a matplotlib plot in a widget

javascript - Twitter、Instagram 或 Facebook 等网络平台如何允许其他网站嵌入其内容?

api - 我可以使用 BlueSnap API 创建 PayPal 订阅吗?