通过 https 的 Google 地图
我们使用免费地图 API 密钥通过 https
使用 Google 地图。 Google Maps API 常见问题解答:
Google Maps JavaScript API 和 Google Static Maps API 可以 由 Google Maps API Premier 通过安全 (https) 连接访问 顾客。 如果 Google Maps API 与免费 Maps API 密钥一起使用 在安全站点上,浏览器可能会警告用户有关不安全的信息 屏幕上的对象。
我对上述内容的理解是,API 无论如何都会工作,但用户可能会收到安全警告。 然而,对于我们来说,地图根本不会显示,导致页面完全无法使用。
有谁知道 Google 是否阻止通过 https 使用免费地图 API 密钥使用地图 API?
We are using Google Maps over https
using a free maps API key. The Google Maps API FAQ says:
The Google Maps JavaScript API and Google Static Maps API can be
accessed over a secure (https) connection by Google Maps API Premier
customers. If the Google Maps APIs are used with a free Maps API key
on a secure site, the browser may warn the user about non-secure
objects on the screen.
My understanding of the above is that the API will work anyway, but users might get a security warning. For us, however, the map will not display at all, rendering the page completely unusable.
Does anybody know if Google is blocking use of the maps API over https with free maps API keys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
自 2011 年 3 月 15 日起,任何人都可以通过 https://maps-api-ssl 使用该 API。 google.com/
http://googlegeodevelopers.blogspot.com/2011/03/maps-apis-over-ssl-now-available-to-all.html
As of March 15th, 2011, anyone may use the API at https://maps-api-ssl.google.com/
http://googlegeodevelopers.blogspot.com/2011/03/maps-apis-over-ssl-now-available-to-all.html
快速浏览一下谷歌地图首要网站,似乎他们可能正在阻止它。 列出的功能之一是“能够通过 https 提供安全地图”
http:// code.google.com/apis/maps/documentation/premier/
好的,这里有一些更具体的信息:
http://code.google.com/apis/maps/faq.html#ssl
看来您可能会得到一张空白地图,因为您正在尝试使用 https a 进行访问仅向高级会员提供的服务
From a quick look at the google maps premier site it seems like they probably are blocking it. One of the listed features is the "ability to provide secure maps over https"
http://code.google.com/apis/maps/documentation/premier/
Okay, here is some more specific info:
http://code.google.com/apis/maps/faq.html#ssl
It seems like you are probably getting a blank map because you are attempting to access with https a service that is only available to premiere members
您可能应该使用协议相对 URL。
You should probably use a protocol relative URL.
安装 SSL 证书后,我只需要做一个简单的更改即可使一切正常工作。
从这:
到这:
After installing SSL certificate, I just had to do a simple change for everything to work.
From this:
To this:
不,即使您通过 https 登录使用免费的 google API,google 也会让您显示地图。
它肯定会给您一个弹出框,询问是/否,但您的地图肯定会显示。
no, google will let you display the map even if you are using free google API's over https login.
It definitely gives you a pop up box asking for a yes/no but your map will be displayed for sure.
您也许可以通过使用 OpenStreetMap 来解决该问题。 它并没有提供一个超级简单的解决方案,因为 OpenStreetMap 的主图块服务器不支持 HTTPS 连接,但是您可以使用 OpenStreetMap 执行各种 Google 永远不允许的操作。
OpenStreetMap 论坛上对此有更多讨论: http://forum.openstreetmap.org/ viewtopic.php?id=5546
You might be able to work around the problem by using OpenStreetMap instead. It doesn't present a super easy solution, because OpenStreetMap's main tile server does not support HTTPS connections, however there are various things you're allowed to do with OpenStreetMap which google would never allow.
Some more discussion of this on the OpenStreetMap forum: http://forum.openstreetmap.org/viewtopic.php?id=5546