Hi All,

The OpenLayer.Select.Feature allows either a single layer or an array of layers to be passed into the constructor. If an array of layers is passed to the control then all the layers are collected up and put into a OpenLayers.Layer.Vector.RootContainer.

This caused an error where I could no longer set opacity on a layer when it had been added to a select control e.g.

        var map = new OpenLayers.Map('map');
        var vectorLayer = new OpenLayers.Layer.Vector();

var tool = new OpenLayers.Control.SelectFeature([vectorLayer], {map: map});
        vectorLayer.setOpacity(0.3); //works
console.log(vectorLayer.div.childNodes[0].firstChild); //<g id="OpenLayers.Layer.Vector_37_root" style="opacity: 0.3;">
        map.addControl(tool);
        tool.activate();
//vectorLayer.setOpacity(0.5); //will no longer work as the "element is null" when trying to set the opacity
        console.log(vectorLayer.div.childNodes[0].firstChild); //null

Should the setOpacity function be overriden in the OpenLayers.Layer.Vector class to take this into account? I can file this as a ticket if it is an issue rather than just my misunderstandings,
Regards,

--
web:http://geographika.co.uk
twitter: @geographika


_______________________________________________
Dev mailing list
d...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-dev

Reply via email to