Google 映射 API 和 Github 页面

Google Maps API and Github pages

所以我试图将我的简历放在 git 页上,它包含 google 地图 API,当我在没有任何服务器的情况下打开文件时它 运行很好。但是当我 运行 它在我的 git 中心页面上时,它会抛出错误:

Mixed Content: The page at 'https://jcook894.github.io/My_Resume/' was loaded over HTTPS, but requested an insecure script "'http://maps.googleapis.com/maps/api/js?libraries=places&key=XXXXXXXXXXXXXXXXXXXXXX'". This request has been blocked; the content must be served over HTTPS.

然后是这个错误:

helper.js:121 Uncaught ReferenceError: google is not defined at initializeMap

我的 api 密钥是不是有什么问题没有通过?

没关系,刚刚意识到我忘记将 s 添加到 https -_-

要解决混合内容的问题,只需通过 https:

加载 google 地图
https://maps.googleapis.com/maps/api/js?libraries=places&key=XXXXXX

有关 GitHub 页面和混合内容的详细信息,请参阅 the documentation