On Dec 9, 8:51 am, Juan <[EMAIL PROTECTED]> wrote:
> Hi
>
> Is possible change the opacity of the map?
>
> I can change the opacity using div elements, but, it change the
> markers too.
>
> I only want to change map opacity.
>
> Thanks
You can change the opacity of an arbitrary DIV on the fly with:
function setOpacity(div,opacity)
{
if (document.all)
{
div.filters.alpha.opacity=Math.round(opacity*100);
}
else
{
div.style.opacity=opacity;
}
}
It will not work in IE6 if the DIV contains transparent PNGs loaded
with the "AlphaImageLoader" filter because it is incompatable with the
"Alpha" filter.
I believe the map tiles are contained in:
whatever.getContainer().childNodes[0].childNodes[0]
Thus:
var div=whatever.getContainer().childNodes[0].childNodes[0];
var opacity=0.5;
setOpacity(div,opacity);
will set the opacity of the tile layer to 50%.
You could use "whatever.getContainer()" itself but you will change the
opacity of your overlays (markers shadows controls polys) too, many of
which contain transparent PNGs.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---