Google Maps API v3.19在Internet Explorer Quirks模式下损坏 [英] Google Maps API v3.19 Broken in Internet Explorer Quirks Mode

查看:80
本文介绍了Google Maps API v3.19在Internet Explorer Quirks模式下损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2015年2月17日,Google Maps API版本3.19成为默认地图发布(请参阅​​ https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog )。使用怪癖模式时,该版本似乎在Internet Explorer中引发问题,如下面的测试页面是我从受此问题影响的应用程序生成的(因此,这可能包含比此处所需更多的代码):

 < html xmlns =http://www.w3.org/1999/xhtml> 
< head>
< title> Google地图测试页< /标题>
< / head>
< body style =margin:0; padding:0>
<! - 在此URL的末尾添加?v = 3.18将'修复'问题 - >
< script src ='http://maps.googleapis.com/maps/api/js'type ='text / javascript'>< / script>
< script type ='text / javascript'>
函数initialize(){
top.google.maps.visualRefresh = true;
var mapOptions = {
zoom:13,
center:new google.maps.LatLng(51.5072,0.1275),
mapTypeId:google.maps.MapTypeId.ROADMAP,
scaleControl:true,
overviewMapControl:true
};
this._map = new google.maps.Map(document.getElementById('myMap'),mapOptions);
}

google.maps.event.addDomListener(window,'load',initialize);
< / script>

< div id =myMapstyle =width:500px; height:500px; position:relative;>< / div>
< / body>
< / html>

Firefox和Chrome都会正确显示可用的地图,而IE会在Google地图中产生深层错误代码读取'无法获取显示属性。无效的参数''我试过调试代码,但它被混淆了,使它成为一个痛苦的挑战。

强制版本返回到最后一个'frozen'版本(3.18 )暂时解决了这个问题,但这只是一个临时解决方案。



任何人都可以提出一个解决方案,而不是向Google报告这个问题,并希望他们解决这个问题?




附加说明:

当我写信时,我注意到这里的信息 https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog 发布的内容为:

 实验:3.20 
发行:3.19
Frozen:3.18

版本3.17将被移除。 3.17或之前的任何版本的请求现在都会提供3.18版本。



此页 https://developers.google.com/maps/documentation/javascript/basics#Versioning 说(在页面底部):

 版本3.18参考(版本)
版本3.19参考(版本)
版本3.17参考b版本3.0 - 3.16已退役。

这很混乱,但我认为Changelog链接是更新的信息来源。这种差异令我困惑,所以我认为值得分享观察。 / strong>



昨天Google确认这是一个Bug - 请参阅 https://code.google.com/p/gmaps-api-issues/issues/detail?id=7675 - 并建议'我们' '



感谢您的意见和建议,但到目前为止,我一直无法找到解决办法,使我的应用程序能够完全工作因为其他页面组件依赖于怪癖模式,因此需要创建大量工作来让整个事情再次运行。我希望Google的关注能够帮助我解决这个问题。






更新21-Feb-15:



https://code.google.com/p/gmaps-api-issues/issues/detail?id=7675 现在显示'将在下周部署一个修复程序'。

解决方案

我很高兴地说谷歌以非常积极的方式回应了这个问题;他们很快就将它归类为一个bug,并建议他们正在研究它,今天我再次测试,看到'怪癖'问题不再存在,我的应用程序再次运行。



我问的问题是'有谁能提出一个解决方案,而不是向Google报告这个问题,并希望他们解决它?'。我看到这个问题的应用程序(显然)严重依赖于怪癖模式,所以当试图去除依赖时,我看到了页面上其他组件的一些问题 - 即问题变得更大。因此,Google解决这个问题确实是真正为我工作的唯一答案,我很高兴他们做到了。



感谢大家的帮助和贡献。


Version 3.19 of the Google Maps API became the default maps 'release' on the 17th Feb 2015 (See https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog). The release appears to be causing issues in Internet Explorer when using quirks mode, as is demonstrated by the following test page that I produced from an application which is affected by this issue (and so this may include more code than is necessary here):

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Google Maps Test Page</title>
</head>
<body style="margin:0; padding:0">
    <!-- Adding ?v=3.18 onto the end of this URL will 'fix' the problem -->
    <script src='http://maps.googleapis.com/maps/api/js' type='text/javascript'></script>
    <script type='text/javascript'>
    function initialize() {
        top.google.maps.visualRefresh=true;
        var mapOptions = {
            zoom: 13,
            center: new google.maps.LatLng(51.5072, 0.1275),
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            scaleControl: true,
            overviewMapControl: true
        };
        this._map = new google.maps.Map(document.getElementById('myMap'), mapOptions);  
    }

    google.maps.event.addDomListener(window, 'load', initialize);
    </script>

    <div id="myMap" style="width:500px;height:500px;position:relative;"></div>
 </body>
 </html>

Both Firefox and Chrome will properly show a useable map, while IE raises an error deep in the Google Maps code which reads 'Could not get the display property. Invalid argument.' I've tried debugging the code but it is obfuscated, making it a painful challenge.

Forcing the version back to the last 'frozen' release (3.18) fixes the issue for the time being, but this is only a temporary resolution.

Can anyone suggest a resolution other than report this to Google and hope they fix it?


Additional note:

As I write I note that the information here https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog says the releases are:

Experimental: 3.20
Release: 3.19
Frozen: 3.18 

Version 3.17 will be removed. Requests for 3.17 or any prior version will now be served version 3.18'

While this page https://developers.google.com/maps/documentation/javascript/basics#Versioning says (at the bottom of the page):

Version 3.18 Reference (Release)
Version 3.19 Reference (Experimental)
Version 3.17 Reference (Frozen)
Versions 3.0 - 3.16 have been retired.

This is rather confusing but I would think the Changelog link to be the more up to date source of information. This difference confused me so I thought it worth sharing the observation.


Update 20-Feb-15:

Yesterday Google confirmed this as a Bug - see https://code.google.com/p/gmaps-api-issues/issues/detail?id=7675 - and advised 'We're looking into a fix.'

Thanks for the comments and suggestions, but so far I haven't been able to find a work around which allows my application to work fully as other page components depend on quirks mode, creating a good deal of work to get the whole thing working again. I'm hopeful that Google's attention will resolve this for me.


Update 21-Feb-15:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=7675 now indicates 'A fix will be deployed in the coming week.'

解决方案

I'm glad to say that Google responded to this issue in a very positive way; they quickly categorised it as a bug, advised they were working on it and today I'm testing again and see that the 'quirks' issue is no more and my application is again behaving.

The question I asked was 'Can anyone suggest a resolution other than report this to Google and hope they fix it?'. The application where I saw this issue is (evidently) heavily dependent on quirks mode and so I saw a number of issues with other components on the page when trying to remove that dependency - i.e. the issue became much bigger. Hence Google fixing this issue was indeed the only answer which really worked for me and I'm glad that they did.

Thanks for everyone's help and contribution.

这篇关于Google Maps API v3.19在Internet Explorer Quirks模式下损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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