I just noticed that pages with gmaps that are working fine in Firefox and Safari have a blown layout in IE7. In the pages affected, I'm using the gmap_simple_map function in a node template to render the map. You can see an example of the problem here:

http://www.utahnordic.com/skiing/locations/xtest

The basic set-up is Drupal 6.9 with LiteJazz 1.7 and suckerfish menus. I just embedded gallery2 yesterday and while investigating a similar problem today on the embedded gallery page, I realized that all pages with gmaps had the same problem (i.e. suckerfish menus and overall layout corrupted).

I've got no real experience troubleshooting this sort of problem so any ideas or advice is appreciated!

Comments

bdragon’s picture

Well, it seems to be something in gmap.css. Hmm..

bdragon’s picture

Hmm, or maybe not. It worked once, then stopped working. (I only have IE6 handy...)

dave bruns’s picture

Any ideas on how I should troubleshoot? I spent some time yesterday pulling apart the HTML source to see if I could pinpoint the problematic CSS file or script, but I could never get the page to build correctly no matter what I removed. This made me think that there is some sort of script problem -- perhaps an error condition that happens as the page loads initially. I only have IE 7, so that's what I'm testing with.

dave bruns’s picture

Update - I finally did trace the problem to the gmap.css stylesheet. Troubleshooting further is harder than I would think, partly because IE seems to want to cache the css files, making it hard to test changes to gmap.css.

For now, I've simply disabled gmap.css by renaming the file on the server. I'm only using maps in a few situations, and I can't see a difference in the way they display - what am I giving up by not using gmap.css?

bdragon’s picture

Ahh, caching problems. That makes sense.

You aren't missing much by having gmap.css disabled. The align= stuff in macros won't work, the copyright string will stick out of the right side of very small maps, and I think that's about it.

bdragon’s picture

I just removed an old hack from gmap.css that *might* have an effect on this.

http://drupal.org/cvs?commit=171214
http://drupal.org/cvs?commit=171215

tassoman’s picture

Version: 6.x-1.0 » 6.x-1.1-rc1

The problem still exists.

So @ line 266 of gmap.module you could introduce a check against HTTP_USER_AGENT to solve the caching problem with IE:

function _gmap_doheader() {
  static $gmap_initialized = FALSE;
  if ($gmap_initialized) {
    return;
  }
  $gmap_path = drupal_get_path('module', 'gmap');
  if (!eregi('msie', $_SERVER['HTTP_USER_AGENT'])) {
	  drupal_add_css($gmap_path .'/gmap.css');               #WAS LINE 266
  }
# ........
Aron Novak’s picture

Status: Active » Needs work

The fix in #7 works perfectly!
However the issue does not appear in IE8.
It would be awesome to commit #7 , but exclude IE8 from the condition.