tags:

views:

112

answers:

2

I have a page with a Google Maps div:

<div id="map_canvas" style="width: 100%; height: 332px;" ></div>

If I comment out my CSS, the map loads fine: if I include the CSS, the map controls load, but the map tiles don't load: there's just a grey background.

This is the case even if I put the map div just after the <body> tag, not within any styled element at all. No CSS, it loads fine. With CSS, no map.

Does anyone know what could be causing this? I don't quite understand what the problem can be if no CSS styles are being applied to any element that contains the map.

If more diagnostics are needed, please let me know, and I'll deploy the broken map onto a staging site, so people can look at the source.

UPDATE: OK, the staging site is here - it's a mess, but the map should load.

+2  A: 

Note that Google map controls have a lot more elements than just the outside <div> container. Your CSS might be affecting these elements. For example, you could have an img { display: hidden; } rule that would hide all tiles in the map. I am clearly oversimplifying the example, of course; I doubt it's that simple. :-)

You need to provide a bit more info, in particular snippets of your CSS, for us to be able to help you.

You can also use any DOM inspection tools like IE8's Development Tools, Chrome Developer tools or Firefox add-on Firebug to see the actual CSS applied to the Google map control and see which rules come from where. This would help you identify any possible rules from your CSS that are messing with Google map.

Franci Penov
+2  A: 

It is the overflow: hidden style you have set in your global.css file. remove that and it worked like a charm.

div, p {
    overflow:hidden;
}
Dustin Laine
Genius! Thank you!
AP257