嵌入式Google地图无效

时间:2013-12-18 21:08:32

标签: google-maps

我发现类似帖子建议我需要在iframe URL的末尾添加output = embed但我仍然会收到错误(从jade输出html因此语法)。

Refused to display 'https://www.google.co.uk/maps/preview?f=q' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.


iframe(width="250", height="250", frameborder="0", scrolling="no", marginheight="0", marginwidth="0", src="https://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=London&aq=0&oq=lo&sll=51.528642,-0.101599&sspn=0.815911,1.716614&t=m&ie=UTF8&hq=&hnear=London,+United+Kingdom&ll=51.511307,-0.11982&spn=0.053418,0.085831&z=12&iwloc=A&output=embed"

我在localhost工作。这可能是个问题吗?据我所知,这是因为Google会重定向到新地图。

更新:我已经尝试过常规静态页面,但它确实有效。所以必须使用localhost吗?

1 个答案:

答案 0 :(得分:0)

可能是网址已编码 - & to &

查看修复here

https://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=London&aq=0&oq=lo&sll=51.528642,-0.101599&sspn=0.815911,1.716614&t=m&ie=UTF8&hq=&hnear=London,+United+Kingdom&ll=51.511307,-0.11982&spn=0.053418,0.085831&z=12&iwloc=A&output=embed