Html 如何使用短url嵌入google地图
我有一个不同地方的短谷歌网址表,比如Html 如何使用短url嵌入google地图,html,google-maps,iframe,google-maps-api-3,Html,Google Maps,Iframe,Google Maps Api 3,我有一个不同地方的短谷歌网址表,比如 ID|URL ------ 1|http://goo.gl/maps/7nps 2|http://goo.gl/maps/wZlPp 取决于URL中的参数,我需要在浏览器中显示该位置的嵌入地图 所以,为了嵌入第二张地图,我使用谷歌提供的iframe html脚本: <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="
ID|URL
------
1|http://goo.gl/maps/7nps
2|http://goo.gl/maps/wZlPp
取决于URL中的参数,我需要在浏览器中显示该位置的嵌入地图
所以,为了嵌入第二张地图,我使用谷歌提供的iframe html脚本:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/?ie=UTF8&t=h&ll=40.408791,-3.692586&spn=0.002859,0.00456&z=17&output=embed"></iframe><br /><small><a href="http://maps.google.com/?ie=UTF8&t=h&ll=40.408791,-3.692586&spn=0.002859,0.00456&z=17&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>
它可以工作,但它使用长url:
当我尝试用较短的链接替换它时,它不起作用:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://goo.gl/maps/wZlPp"></iframe><br />
如何在那里使用短链接?当您查看开发人员控制台时,您会看到如下内容:
Load denied by X-Frame-Options: https://maps.google.com/?ie=UTF8&ll=48.858151,2.293611&spn=0.00648,0.021973&t=h&z=16 does not permit cross-origin framing.
因此,问题在于。在这种情况下,不可能使用短链接。当您查看开发人员控制台时,您会看到如下内容:
Load denied by X-Frame-Options: https://maps.google.com/?ie=UTF8&ll=48.858151,2.293611&spn=0.00648,0.021973&t=h&z=16 does not permit cross-origin framing.
因此,问题在于。在这种情况下,不可能使用短链接。不可能将这些链接与iframe一起使用,因为x-frame-options-header设置为SAMEORIGIN,这会阻止将文档加载到外部iframe我说您可以在服务器或客户端中查找目标url,然后使用它不可能将这些链接与iframe一起使用,因为x-frame-options-header设置为SAMEORIGIN,这会阻止文档加载到外部iframe中。我说,您可以在服务器或客户端中查找目标url,然后使用它