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

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

问题描述

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

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>

Firefox 和 Chrome 都会正确显示可用的地图,而 IE 会在谷歌地图代码深处引发错误,内容为无法获取显示属性".无效的论点.'我试过调试代码,但它被混淆了,使它成为一个痛苦的挑战.

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.

强制版本返回上一个冻结"版本 (3.18) 暂时修复了该问题,但这只是临时解决方案.

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.

除了向 Google 报告此问题并希望他们修复它之外,还有人可以提出解决方案吗?

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

附加说明:

在我撰写本文时,我注意到这里的信息 https://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIv3Changelog 说这些版本是:

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 

版本 3.17 将被删除.对 3.17 或任何先前版本的请求现在将在 3.18 版中提供'

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

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

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.

这有点令人困惑,但我认为 Changelog 链接是最新的信息来源.这种差异让我感到困惑,所以我认为值得分享观察结果.

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.

15 年 2 月 20 日更新:

昨天谷歌确认这是一个错误 - 请参阅https://code.google.com/p/gmaps-api-issues/issues/detail?id=7675 - 并建议我们正在研究修复."

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.'

感谢您的意见和建议,但到目前为止,我还没有找到一种解决方法,使我的应用程序能够完全工作,因为其他页面组件依赖于 quirks 模式,创建了大量工作来获得整体事情又开始了.我希望 Google 的关注能为我解决这个问题.

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.

15 年 2 月 21 日更新:

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

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

推荐答案

很高兴 Google 以非常积极的方式回应了这个问题;他们很快将其归类为错误,并建议他们正在处理它,今天我再次进行测试,发现怪癖"问题不再存在,我的应用程序再次正常运行.

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.

我问的问题是除了向 Google 报告并希望他们修复它之外,还有其他人可以提出解决方案吗?".我看到此问题的应用程序(显然)严重依赖于怪癖模式,因此在尝试删除该依赖项时,我看到页面上的其他组件存在许多问题 - 即问题变得更大.因此,谷歌解决这个问题确实是唯一对我有用的答案,我很高兴他们做到了.

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 Mode 中损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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