谷歌地图嵌入网站加载谷歌页面,而不是地图 [英] Google Map embedded in website loading Google page rather than the map

查看:154
本文介绍了谷歌地图嵌入网站加载谷歌页面,而不是地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个网站 - http://www.gyroontario.ca/contact/ 其中内嵌有Google地图。这个工作很好,但突然间,嵌入式地图试图加载Google地图页面,而不是嵌入地图。



如果您加载链接,它最初正确地加载地图,但突然之后,它将所有Google主菜单和边栏加载到地图页面。



是否有某些内容已被更改谷歌,因为我们很长一段时间没有触及该网站。我该如何解决这个问题?



这是嵌入内容的图像:



这是我嵌入的代码:

 < iframe width =525height =350frameborder =0scrolling =nomarginheight =0 marginwidth =0src =https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=zh-TW&amp;geocode=&amp;q=50+Skyway +驱动,+圭尔夫大学,+ ON + N1H + 6H8&放大器;放大器;水溶液=&放大器;放大器; SLL = 51.502241,-3.19941&放大器;放大器; SSPN = 0.260515,0.380058&放大器;放大器,即= UTF8&放大器;放大器; HQ =安培;安培; hnear =天顺+博士+圭尔夫大学,+惠灵顿+县+安大略+ N1H + 6H8,+加拿大&放大器;放大器; T = M&放大器;放大器; 11 = 43.565031,-80.19762&放大器;放大器; SPN = 0.021767,0.045061&安培;安培; Z = 14&放大器;放大器; iwloc = A&放大器;放大器;输出=嵌入>< / iframe中> 






这就是我得到的代码,只是一个简单的谷歌嵌入代码:



解决方案

清理你的页面(line〜85):

  window.onload = function(){
var frames = document.getElementsByTagName(iframe);
for(var i = 0; i< frames.length; i ++){
frames [i] .src + =?wmode = transparent;


$ / code $ / pre

负责加载完整的Google地图页面。
您可以通过创建一个带有Google地图的空页面来轻松检查: iframe 元素(将工作)
并且添加<$ c

BTW:缺少contact / tooltip.css。



I have this website - http://www.gyroontario.ca/contact/ which has a Google Map embedded within it. This has worked fine for many years but all of a sudden the embedded map is trying to load the Google Maps page instead of just embedding the map.

If you load the link, it initially loads the map correctly but then all of a sudden it loads the maps page with all the Google main menu and sidebar.

Is there something that has been changed by Google because we haven't touched the site for a long time. How can I fix this?

This is an image of what it's embedding:

This is the code I've embedded:

<iframe width="525" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=50+Skyway+Drive,+Guelph,+ON+N1H+6H8&amp;aq=&amp;sll=51.502241,-3.19941&amp;sspn=0.260515,0.380058&amp;ie=UTF8&amp;hq=&amp;hnear=Skyway+Dr,+Guelph,+Wellington+County,+Ontario+N1H+6H8,+Canada&amp;t=m&amp;ll=43.565031,-80.19762&amp;spn=0.021767,0.045061&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>


This is how I'm getting the code, just a simple google embed code:

解决方案

Clean up your page (line ~85):

window.onload = function() {
    var frames = document.getElementsByTagName("iframe");
    for (var i = 0; i < frames.length; i++) {
        frames[i].src += "?wmode=transparent";
    }
}

is responsible the loading of the complete google maps page. You can easily check this by creating an empty page with the google maps-iframe element only (will work) and than adding the window.onload from your page.

BTW: contact/tooltip.css is missing.

这篇关于谷歌地图嵌入网站加载谷歌页面,而不是地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆