【发布时间】:2013-04-11 21:59:13
【问题描述】:
我有一个不同地方的简短谷歌网址表,例如,
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>
它有效,但它使用长网址:http://maps.google.com/?ie=UTF8&t=h&ll=40.408791,-3.692586&spn=0.002859,0.00456&z=17&output=embed
当我尝试用较短的链接替换它时,它不起作用:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://goo.gl/maps/wZlPp"></iframe><br />
那里怎么可能使用短链接?
【问题讨论】:
-
无法将这些链接与 iframe 一起使用,因为 x-frame-options-header 设置为 SAMEORIGIN,这会阻止将文档加载到外部 iframe 中
-
我说你可以在你的服务器或客户端中查找目标url然后使用它
标签: html google-maps iframe google-maps-api-3