简体   繁体   English

Google Maps API是否可以在Github Pages上使用?

[英]Does Google Maps API work on Github Pages?

I'm hosting a website on GitHub pages but I keep getting the error 'referrer not allowed' when I try to load the Google Maps API script. 我在GitHub页面上托管了一个网站,但是在尝试加载Google Maps API脚本时,始终出现错误“不允许引荐来源”。 I've added the page's URL to the API console (and I've tried lots of variations) and it keeps saying the same thing. 我已经将页面的URL添加到API控制台(并且我尝试了很多变体),并且一直在说同样的话。

Does anyone know why this might be? 有谁知道为什么会这样吗?

Recreating the API key at https://console.developers.google.com will fix the issue. https://console.developers.google.com上重新创建 API密钥将解决此问题。 And use your current GitHub pages domain URL to generate the API key 并使用您当前的GitHub页面域URL生成API密钥

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM