Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using OpenLayers.Layer.Zoomify to show large image files and this works like a charm. The only thing is that I would like to add some options to that layer ( opacity and transitionEffect) but it doesn't seem to work. Code:

var zoomify = new OpenLayers.Layer.Zoomify( "Zoomify",
  zoomify_url, 
  new OpenLayers.Size( zoomify_width, zoomify_height ),
  { opacity: 0.5, transitionEffect: 'resize'}
);

Isn't this the right way of doing it? Or is it not possible to add these properties to Zoomify layers? Nothing happens to my zoomify layer.

share|improve this question
    
Really neat idea, I'd like to understand how to accomplish this as well! –  Cody Brown Aug 22 '12 at 14:36
add comment

1 Answer 1

Layer Opacity control

enter image description here

var map = null;
    var shade = null;
    var maxOpacity = 0.9;
    var minOpacity = 0.1;
    function changeOpacity(byOpacity) {
        var newOpacity = (parseFloat(OpenLayers.Util.getElement('opacity').value) + byOpacity).toFixed(1);
        newOpacity = Math.min(maxOpacity,
                              Math.max(minOpacity, newOpacity));
        OpenLayers.Util.getElement('opacity').value = newOpacity;
        shade.setOpacity(newOpacity);
    }

http://dev.openlayers.org/releases/OpenLayers-2.12/examples/layer-opacity.html

share|improve this answer
1  
Interesting! But the most important (for me) remains: transitionEffect –  Oskar Karlin Aug 22 '12 at 14:49
    
Oskar like this? dev.openlayers.org/releases/OpenLayers-2.11/examples/… –  Mapperz Aug 22 '12 at 15:06
    
Yes, exactly, but working with Zoomify layers. –  Oskar Karlin Aug 22 '12 at 15:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.