How can you dim or darken the map using a client side control?  I've
attempted to create a filter div on top of the map div with a black
background that can be darkened by changing the opacity.  This works
well.  However, when the filter div is displayed, I lose the ability to
control the map (e.g. pan, zoom, etc -- because filter has a greater
zIndex then div).
I setup an opacity control that goes from 0 to 2.  Anything greater than
1 will darken the map.
map = new OpenLayers.Map(document.getElementById("map"), { controls: []
});
function changeOpacity(byOpacity) {
        var newOpacity =
(parseFloat(OpenLayers.Util.getElement('opacityInput').value) +
byOpacity).toFixed(1);
        newOpacity = Math.min(maxOpacity, Math.max(minOpacity,
newOpacity));
        OpenLayers.Util.getElement('opacityInput').value =
newOpacity.toFixed(1);
        if(newOpacity <=1){
                document.getElementById("filter").style.display="none";
                map.baseLayer.setOpacity(newOpacity);
        }else{
                document.getElementById("filter").style.display="block";

                var dim = newOpacity-1;
                document.getElementById("filter").style.opacity=dim;
        
document.getElementById("filter").style.backgroundColor="black";        
        }
}



_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to