John Smith
John Smith

Reputation: 1

Disable info window shadow in google maps (v2)

Is there any way to disable the automatically generated shadow for the info window for a marker?

I'm trying to get around the bug reported at http://www.google.com/support/forum/p/maps/thread?tid=69bcc3217ee1ac68&hl=en where the shadow has big black marks around it that obscure the view of the map when viewed in IE 8 at any zoom level other than 100%.

Upvotes: 0

Views: 2983

Answers (3)

jrumbinas
jrumbinas

Reputation: 426

There is very simple solution to your problem: hide both shadow layers. This way you can be sure that all objects are hidden (even those added after hide)

var map = GMap2(...);
...
var pane;

//contains the info window shadow image
pane = map.getPane(G_MAP_FLOAT_SHADOW_PANE);
pane.style.display = "none";

//contains the marker shadow images
pane = map.getPane(G_MAP_MARKER_SHADOW_PANE);
pane.style.display = "none";

Yet another question would be how to detect conditions under which layers should be hidden...

Upvotes: 1

wessel
wessel

Reputation: 801

But in V3 you don't use GMap2

I managed to disable the shadows with the following css:

div.gmnoprint div img 
{
    display: none;
}

In V2 you had:

map.getPane(G_MAP_FLOAT_SHADOW_PANE).style.display = "none";
map.getPane(G_MAP_MARKER_SHADOW_PANE).style.display = "none";

Seems that in V3 you can only access the panes in OverlayView (?)

Upvotes: 0

DaveS
DaveS

Reputation: 3294

Looks like, for IE 8 only, you'll have to traverse the dom, find the shadow images (iws3.png), and hide them. If you have jQuery at your disposal, then it's as simple as

$('img[src$="iws3.png"]').hide();

after the map has loaded.

Or, if you don't have jQuery, something like...

var i, imgs = document.getElementsByTagName('img');
for (i = 0; i < imgs.length; i++) {
    if (/iws3\.png/.test(imgs[i].src)) {
        imgs[i].style.display = "none";
    }
}

P.S. @Crescent Fresh, here's a screenshot: alt text

Upvotes: 1

Related Questions