I'm working on a website for a shop and I'm using the GooleMaps Engine Lite to show his location. It works on IE9 and 10, Safari for Windows, iOS and MacOs and Mozilla Firefox, but it's not working on Chrome. If I use the Javascript Console I can see the following error:
我在一家商店的网站上工作,我正在使用GooleMaps引擎Lite来显示他的位置。它适用于IE9和10,Windows, iOS, MacOs和Mozilla Firefox的Safari浏览器,但它并没有在Chrome上运行。如果使用Javascript控制台,可以看到以下错误:
Refused to display 'https://accounts.google.com/ServiceLogin?service=mapsengine&passive=1209600…up=https://mapsengine.google.com/map/embed?mid%3DzehbkDaSW5QM.kyKZHGifzxMc' in a frame because it set 'X-Frame-Options' to 'DENY'.
Could anybody help me?
有人能帮助我吗?
4 个解决方案
#1
3
First time I had the problem it disappeared when I rebooted my computer, but today the problem appeared again. I've read on Google forums that the conflict comes when you are semi-logged with your Google account. If I log out completely my account or log in the map re-starts to work. In Safari you will find the same issue.
我第一次遇到这个问题,当我重启电脑时它就消失了,但今天问题又出现了。我在谷歌论坛上读到过,当你的谷歌账户处于半记录状态时,冲突就来了。如果我完全注销我的帐户或登录在地图重新开始工作。在Safari浏览器中,你会发现同样的问题。
A temporary solution is sandbox the map iframe to forbid it to access the cookies.
临时解决方案是沙箱,地图iframe禁止它访问cookies。
#2
2
https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a
<frame>
or<iframe>
. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.可以使用x帧选项HTTP响应头来指示是否应该允许浏览器在 <框架> 或
The counter-question I have to you is why are you implementing that URL in an iframe, when it specifically tells the browser it does not want to be loaded in an iframe?
我要问的反问题是,为什么你要在iframe中实现那个URL,当它明确告诉浏览器它不想被载入iframe?
Did you follow the instructions at https://support.google.com/mapsenginelite/answer/3024935?hl=en when embedding the map?
您是否遵循了https://support.google.com/mapsenginelite/answer/3024935的指示?在嵌入地图的时候?
- Make sure you have your desired map open and that it is set to be accessible by the Public.
- 确保你有你想要的地图,并且它将被公众所访问。
- Click the folder button.
- 单击文件夹按钮。
- Select Embed on my site.
- 选择嵌入我的网站。
- In the box that appears, copy the HTML under 'Embed on the web,' and paste it into the source code of your website or blog.
- 在出现的框中,将HTML嵌入“嵌入到web”中,并将其粘贴到您的网站或博客的源代码中。
#3
0
You're linking to the Google Account login page for the maps generator, not to a map. The link is probably not what you want.
您正在链接到地图生成器的谷歌帐户登录页面,而不是映射到地图。链接可能不是你想要的。
To make an embeddable map from Google Maps Engine,
要从谷歌地图引擎制作一个可嵌入的地图,
- click on the green "Share" button on the top right and set you map to public
- 点击右上角的绿色“共享”按钮,并将地图设置为公共。
- click on the folder icon on the top left (next to "Add layer") and choose "Embed on my site"
- 点击左上方的文件夹图标(下一步是“添加图层”),然后选择“嵌入我的网站”
#4
0
1) in the left bottom corner click on 6 teeth wheel , 'Share and integration of map' 2) In opened dialog press on 'integrate map' 3) you got iframe line with correct src .
1)在左下角点击6个齿轮,在“整合图”上打开的对话框中“分享和整合地图”2)你得到的iframe与正确的src。
#1
3
First time I had the problem it disappeared when I rebooted my computer, but today the problem appeared again. I've read on Google forums that the conflict comes when you are semi-logged with your Google account. If I log out completely my account or log in the map re-starts to work. In Safari you will find the same issue.
我第一次遇到这个问题,当我重启电脑时它就消失了,但今天问题又出现了。我在谷歌论坛上读到过,当你的谷歌账户处于半记录状态时,冲突就来了。如果我完全注销我的帐户或登录在地图重新开始工作。在Safari浏览器中,你会发现同样的问题。
A temporary solution is sandbox the map iframe to forbid it to access the cookies.
临时解决方案是沙箱,地图iframe禁止它访问cookies。
#2
2
https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a
<frame>
or<iframe>
. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.可以使用x帧选项HTTP响应头来指示是否应该允许浏览器在 <框架> 或
The counter-question I have to you is why are you implementing that URL in an iframe, when it specifically tells the browser it does not want to be loaded in an iframe?
我要问的反问题是,为什么你要在iframe中实现那个URL,当它明确告诉浏览器它不想被载入iframe?
Did you follow the instructions at https://support.google.com/mapsenginelite/answer/3024935?hl=en when embedding the map?
您是否遵循了https://support.google.com/mapsenginelite/answer/3024935的指示?在嵌入地图的时候?
- Make sure you have your desired map open and that it is set to be accessible by the Public.
- 确保你有你想要的地图,并且它将被公众所访问。
- Click the folder button.
- 单击文件夹按钮。
- Select Embed on my site.
- 选择嵌入我的网站。
- In the box that appears, copy the HTML under 'Embed on the web,' and paste it into the source code of your website or blog.
- 在出现的框中,将HTML嵌入“嵌入到web”中,并将其粘贴到您的网站或博客的源代码中。
#3
0
You're linking to the Google Account login page for the maps generator, not to a map. The link is probably not what you want.
您正在链接到地图生成器的谷歌帐户登录页面,而不是映射到地图。链接可能不是你想要的。
To make an embeddable map from Google Maps Engine,
要从谷歌地图引擎制作一个可嵌入的地图,
- click on the green "Share" button on the top right and set you map to public
- 点击右上角的绿色“共享”按钮,并将地图设置为公共。
- click on the folder icon on the top left (next to "Add layer") and choose "Embed on my site"
- 点击左上方的文件夹图标(下一步是“添加图层”),然后选择“嵌入我的网站”
#4
0
1) in the left bottom corner click on 6 teeth wheel , 'Share and integration of map' 2) In opened dialog press on 'integrate map' 3) you got iframe line with correct src .
1)在左下角点击6个齿轮,在“整合图”上打开的对话框中“分享和整合地图”2)你得到的iframe与正确的src。