<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi All,<br>
    <br>
    The OpenLayer.Select.Feature allows either a single layer or an
    array of layers to be passed into the constructor. <br>
    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. <br>
    <br>
    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. <br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var map = new OpenLayers.Map('map');&nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var vectorLayer = new OpenLayers.Layer.Vector();<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var tool = new
    OpenLayers.Control.SelectFeature([vectorLayer], {map: map});<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vectorLayer.setOpacity(0.3); //works<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; console.log(vectorLayer.div.childNodes[0].firstChild);
    //&lt;g id="OpenLayers.Layer.Vector_37_root" style="opacity:
    0.3;"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map.addControl(tool);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tool.activate();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //vectorLayer.setOpacity(0.5); //will no longer work as the
    "element is null" when trying to set the opacity<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; console.log(vectorLayer.div.childNodes[0].firstChild);
    //null<br>
    <br>
    Should the setOpacity function be overriden in the
    OpenLayers.Layer.Vector class to take this into account?<br>
    I can file this as a ticket if it is an issue rather than just my
    misunderstandings,<br>
    Regards,<br>
    <br>
    <div class="moz-text-html" lang="x-western"> <font color="#888888">--<br>
        web:</font><a href="http://geographika.co.uk"><font
          color="#888888"> </font>http://geographika.co.uk</a><br>
      <font color="#888888">twitter: @geographika<br>
      </font><br>
    </div>
    <br>
  </body>
</html>