Hi,
I was wondering if it is possible to adjust the opacity of a loaded tile layer via a dhtml control's event, say a slider. I've tried it but the tile layer seems unaffected by the slider setting a new opacity value even though I've made sure it's a float between 0 and 1. It doesn't even work when I hard code an appropriate value to be set on event.

Adjustable tile layer opacity via DHTML?
Prasenna
I was just working on this last night; it's pretty easy:
In my slider event, I calculate the percentage of transparency (based on the sliding scale), set the opacity, delete the layer, and then add it again:
var trans = CalculateTransparency();
tileLayer1.Opacity = trans;
map.DeleteLayer('lidar');
map.AddLayer(tileLayer1);
I've requested the ability to alter a layer without having to remove it and re-add it to the map. It'll be a while before we see any fix, but hopefully it will get in there at some point.
Steven Gilissen
David Mc Dermid
da_Codez
Another temporary option would be to scan the page's DOM and look for img tags that have a src set to your location of custom tiles. For example, I see a series of img tags like:
tileLayer.zIndex = 100;
tileLayer.Opacity=0.5;
This ends up with img tags, like the one I pasted above, on the page with a z-index = 1, and therefore not visible. Zooming in and out on the map gets the tiles to show up correctly some of the time. I'm curious to know if others are seeing this behavior.
darthziv
John.
Tigerroad
That said if you have to time to do it manually feel free to post it :)
John.
Terry Showers
I went with the "delete/re-add the tile layer" solution, which works well enough except I'm getting "hour-glassed" repeatedly with the slide-bar. So, I opted for a series of 5 radio buttons with discrete incemental values between 0 an 1; works really well! :) Then I added a dropdown that loads a list of all my tile layers per map view on the fly; then my transparency control acts upon the selected layer. I love it!!
Cheers