I'm attempting to set the Opacity property of the YahooOverlay in the code behind of my page, but setting the property does not seem to have any effect. I can set the Isvisible property as well as other's without a problem. I only have a YahooOverlay and an InMemoryMarkerOverlay on my map and I want to set the YahooOverlay to be more transparent. Am I missing something simple or is this a bug with the property?
YahooOverlay Opacity
Jeremy,
We think to make Yahoo overlay transparent is not a good scenario before so that we didn't make this property works. We have a workaround for you temporary; please have a try.var OnMapCreated = function(map){
var yahooOverlay = map.getLayer('yahooOverlayId');
yahooOverlay.div.style.opacity = .2;
}
Let me know if you have more queries.
Thanks,
Howard
Howard,
Thanks for the reply. Unfortunately this had no effect, even when I copied the supplied code into the OnMapCreated event and set the opacity = 0. When I moved this code into the OnMapCreating event, the map did not display at all, even setting the opacity = 1. Is there a way to make this work, or am I missing something?
Jeremy
Howard,
I was able to get this working. It seems the reason the code you supplied did not work is because the 'opacity' parameter does not work in IE8. The code that worked for me was the following
var OnMapCreated = function(map)
{
var yahooOverlay = map.getLayer("YahooOverlay");
yahooOverlay.div.style.filter = 'alpha(opacity = 25)';
}
Thanks for your help!
Jeremy,
Thanks for sharing; I just provide the workaround while didn’t test in all browsers. Hope it works fine and let me know if you have more questions.
Thanks,
Howard