[OpenLayers-Trac] [OpenLayers] #3608: Layer.Vector.setOpacity won't work inside Vector.rootContainer

OpenLayers trac-20090302 at openlayers.org
Wed Jan 18 08:05:24 EST 2012


#3608: Layer.Vector.setOpacity won't work inside Vector.rootContainer
-------------------------------+--------------------------------------------
 Reporter:  mrenninger         |       Owner:  crschmidt   
     Type:  feature            |      Status:  new         
 Priority:  minor              |   Milestone:  2.12 Release
Component:  Layer.Vector       |     Version:  2.11        
 Keywords:  vector setOpacity  |       State:              
-------------------------------+--------------------------------------------
 setOpacity won't work on a vector layer, if the vector layer is with other
 vector layers in a SelectFeature-Control (the SelectFeature-Control has
 than a Vect.rootContainer). With the following it will work:

 {{{
 OpenLayers.Layer.Vector.prototype.setOpacity = function(opacity) {
         if (opacity != this.opacity) {
                 this.opacity = opacity;
                 var element = this.renderer.root;
                 OpenLayers.Util.modifyDOMElement(element, null, null,
 null, null,
                                 null, null, opacity);
                 if (this.map != null) {
                         this.map.events.triggerEvent("changelayer", {
                                 layer : this,
                                 property : "opacity"
                         });
                 }
         }
 };
 }}}

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3608>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list