8

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

Community
  • 1
  • 1
Elliveny
  • 2,159
  • 1
  • 20
  • 28
  • Your test page may or may not throw IE into quirks mode. Can you try it with a proper HTML5 `` header? – Pointy Feb 18 '15 at 15:28
  • 1
    The application is fairly old and the HTML line appears to be necessary for other elements of the page. However, I changed it and it does indeed provide a usable map, though the navigation arrows in the top left appear rather oddly and move a little when navigating the map. Thanks for the hint on the DOCTYPE, I'll investigate the impact now. – Elliveny Feb 18 '15 at 15:43
  • When Internet Explorer thinks it's being presented with a document that requires old behavior, it changes its behavior **a lot**. – Pointy Feb 18 '15 at 15:44
  • @Pointy - Thanks for your help so far, it's got me a little further. I raised the navigation arrows display issue in another question http://stackoverflow.com/questions/28588236/google-maps-navigation-controls-distorted-wiggling-in-ie11. Unfortunately I've proved I really need a solution which will work with the existing header as I've already seen a number of other issues with other components on the page when I change it to – Elliveny Feb 18 '15 at 16:18
  • Well quirks mode issues can be hard to fix, but unfortunately there's no way to get the browser to behave "half way" between quirks mode and "good" mode. A lot of old pages are simply broken, and the only way to really eliminate the problems are to fix the page code. – Pointy Feb 18 '15 at 16:21
  • We're having a similar issue with this except our problem is within a Delphi application. We have a delphi TWebBrowser embedded in our application that lets all of our customers view a map. The html file that contains the map does have but the problem still exists. – FLDelphi Feb 18 '15 at 16:30
  • Also, broken in IE8. – AMissico Feb 19 '15 at 21:56
  • Thanks. I revised the title to 'Google Maps API v3.19 Broken in Internet Explorer' (was 'Google Maps API v3.19 Broken in IE11') – Elliveny Feb 19 '15 at 23:01

9 Answers9

10

Found the same issue today with a web app I've just inherited. For some reason the previous devs were forcing IE into quirks (ie7) mode and the google api issue started today. I've updated the main html page to use IE edge mode by changing the html head section from

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
 <head>
    <meta http-equiv="X-UA-Compatible" content="IE=7" /> 
 .....

to

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
 <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
.....

(if you are missing it add the ie-edge meta... line)

and its fixed it so far.

Now to find out why the previous devs were forcing IE7 mode....

ajg
  • 1,743
  • 12
  • 14
  • 1
    This worked in my case, which was an embedded TWebBrowser inside of a Delphi project. – FLDelphi Feb 18 '15 at 17:31
  • Thank for you this..... I know it is not protocol to say "thank you" on SO... But I had just spent 2+ hours trying to figure out why scripts were not working in Delphi TWebBrowser but was working fine in standard browsers (IE included!). – M Schenkel Feb 25 '16 at 21:03
  • I have notice that Zoom buttons have dissapeared from map when I set content="IE=edge". Do you know why? – mggSoft Oct 23 '17 at 10:40
4

SOLVED: Had same problem with IE8 (XP), IE9 (Win7) and compatibility mode in Win 7 and XP. I added the version number and voila! Fixed.

http://maps.googleapis.com/maps/api/js?v=3&key=...

Specifying v=3 forces the stable release. My old code without this version flag was interpreted by Google as I wanted the experimental version which I never want for my production server.

FYI, I use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Joseph
  • 41
  • 2
1

We are using the GMLib Google Maps delphi component and we had the same problem. The GMLib component uses the TWebBrowser component inside.

Within the resource files of the GMLib component we found a map.html file. We added the following line to the section of the html file.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

We then recompiled the resource files into the component, recompiled the delphi project and it worked.

I suppose this is one of the downsides of using relatively unsupported free components.

We are now considering moving to a commercial paid for google maps component to reduce the risk of this happening again.

Chris Fox
  • 21
  • 4
0

In my case (.net 4 visual c# with a webbrowser integrated) to fix this issue I just add &v=3 It seems that if you don't specify the version it will use the experimental one ... strange.

0

I have an application in Delphi using TWebBroser, this was the temporary solution that I found, but is not 100% because to solve this I had to add a Key on Windows, using regedit. Forcing IE to emulate in the version informed on the Key I created, for better understanding look at the item Browser Emulation inside this link https://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx . This solution only works if the IE version stated in the Key is installed.

0

We also faced the same issue in a C# program using the standard .net WebBrowser control.

We also solved the problem by adding the line

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Note that it didn't work on a Vista configuration with Internet Explorer 7, but it was OK after installation of IE 9 (more than 3 hours for installing Service pack1, service pack 2, 2 microsoft corrective patches and finally IE9 itself).

0

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.

Elliveny
  • 2,159
  • 1
  • 20
  • 28
0

In my case, IE 11 not response with Google Maps .... My solution is: point one:

Add header :

Point two:

Add JS V3:

Regards

Armando Cordova
  • 739
  • 7
  • 5
-1

This works fine

< script src="https://maps.googleapis.com/maps/api/js&v=3.18" type="text/javascript"></script>

This don't

< script type="text/javascript" src="https://maps.googleapis.com/maps/api/js&v=3.18"</script>
Abraham Uribe
  • 3,118
  • 7
  • 26
  • 34
enpelolo
  • 1
  • 1
  • Neither of those are valid links to v=3.18; the first needs a "?" (and remove the "&"), the second needs a "?" (and remove the "&") and is missing a ">" – geocodezip Feb 20 '15 at 14:30
  • Your are rigth in both cases. I edit my code line erasing the key and didn't check the results. But the idea is the same. – enpelolo Feb 20 '15 at 23:21