Hi List,<br><br>I&#39;m hoping someone here can help me to see the error in my code. I am part of a project building a highly interactive weather monitoring system. As such, we are using OpenLayers 2.11 as our choice of map engine.<br>


<br>I have 11 layers of radar imagery. Each layer is a different time step. In order to manage the layering in our application, I need these layers to always be indices 20 to 30. They are served from a tile mapping server and created like:<br>


<br>var radar = new OpenLayers.Layer.TMS(thisClass.radarTimes.getItem(i), thisClass.ridge,<br>                                {<br>                            layername : thisClass.radarTimes.getItem(i),<br>                            type: &#39;png&#39;,<br>


                            isBaseLayer: false,<br>                            getURL: radar_url,<br>                            mapType: &quot;radar&quot;,<br>                            frameTime: new Date(thisClass.realTimes.getItem(i) * 1000),<br>


                            displayInLayerSwitcher: true,<br>                            opacity: thisClass.getOpacity()<br>                                });<br><br>This all works fine. I have all layers loaded. However, immediately after that, I attempt:<br clear="all">


<br>thisClass.map.addLayer(radar);<br>thisClass.map.setLayerIndex(radar, startIndex);<br><br>Where this is inside a loop with start index of 20...21...etc.<br><br>If I log the actual indices, I can see that the layer is never changing. for instance:<br>


console.log(startIndex);  (Will be as expected: 20)<br>console.log(thisClass.map.getLayerIndex(radar)); (Will be arbitrary: 4)<br><br>If I jump through some hoops to get it accessible through firebug, Attempting the setLayerIndex results in<br>

<br><div class="errorTitle focusRow subLogRow "><span class="errorMessage ">TypeError: layer.setZIndex is not a function</span></div><span class=" "></span><div class="errorSourceBox errorSource-syntax focusRow subLogRow ">

<img src="chrome://firebug/content/blank.gif" title="Break On This Error" class="errorBreak a11yFocus "><a title="+zIdx*5);},resetLayersZIndex:function(){for(var i=0,len=this.layers.length;i&lt;len;i++){var layer=this.layers[i];this.setLayerZIndex(layer,i);}},addLayer:function(layer){for(var i=0,len=this.layers.length;i&lt;len;i++){if(this.layers[i]==layer){var msg=OpenLayers.i18n(&#39;layerAlreadyAdded&#39;,{&#39;layerName&#39;:layer.name});OpenLayers.Console.warn(msg);return false;}}" class="errorSource a11yFocus ">+zIdx*5);},resetLayersZIndex:function(...ers.Console.warn(msg);return false;}}<br>

<br>Any idea what I might be doing wrong?<br><br>Thanks,<br>Matt<br></a></div><br>-- <br><i>Information Technology Officer</i><br><span style="font-size:x-small"><font color="#3333FF">National Weather Service<br>La Crosse, Wisconsin<br>

</font></span><br>