My Drupal site that displays maps through the Google Maps API stopped displaying them in Internet Explorer 7, although it continues to do so in FF, Safari, and IE6.

Here is a current example from the Google Maps API developers site. It displays OK in IE7:
http://code.google.com/apis/maps/documentation/examples/map-simple.html

Here is that same example code pasted in to a test page on my Drupal site. It does not display in IE7, although it does in other browsers:
http://swonders.info/after_las_vegas/node/21

Here is a cryptic (to me) comment I received on a Google Maps API forum
Your map script should be in the <head> section of your page .
Only use <body></body> once.
<body class="sidebars" onload="load()" onunload="GUnload()">

I'd appreciate help in resolving this.

Thank you.

Matt

Comments

scenicwonders’s picture

Someone in the Google Group for Google Maps API helped me solve this.

It appears that the problem has always existed in copying Google API examples into Drupal content as the examples' use of "head" and "body" sections conflicts with Drupal's. IE7 is apparently less forgiving of this conflict than previous browsers.

For those encountering the same problem:

Here is the API example: http://code.google.com/apis/maps/documentation/examples/map-simple.html

Here is that example code corrected to work within Drupal content: http://swonders.info/after_las_vegas/node/21

Here is the Google Group for Google Maps API thread that helped:
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/982e...

Matt

slappyjoe’s picture

fyi this is the code that needs to be added right outside of the initialize function:

window.onload=function(){window.onload;initialize()};
window.onunload=function(){window.onunload;GUnload()};

Slappy