<span class="Apple-style-span" style="border-collapse: collapse; font-family: verdana; ">hi all, <br>on my webapp I have distributed legends where you can switch on/off different layers. All of these layers refer to the same GeoServer. <br>
As far as I know, I can design my webapp in two ways: <br>1) Just an Openlayers layer and I add/remove layers from layers parameter when user switch on/off a layer <br><br>   layer = new OpenLayers.Layer( &quot;OpenLayers WMS&quot;,&quot;<a href="http://myGeoServer/wms" target="_top" rel="nofollow" style="font-size: 1em; ">http://myGeoServer/wms</a>&quot;,{layers: layer1,layer2...} <br>
<br>2) create &quot;on-the-fly&quot; a new OpenLayers.Layer with a function when user selects a still not visible layer: <br>            var add_lay=function(layerName,lay) <br>                                { <br>                         var new_lay=&quot;edit_&quot;+layerName+&quot; =new OpenLayers.Layer.WMS( &#39;my WMS&#39;,&#39;<a href="http://myGeoserver&#39;" target="_top" rel="nofollow" style="font-size: 1em; ">http://myGeoserver&#39;</a>,{layers:&#39;topp:&quot;+lay+&quot;&#39;} );&quot;;            eval(new_lay);        <br>
                      eval(&quot;map.addLayer(edit_&quot;+layerName+&quot;)&quot;);        <br>                                } <br><br>The problem of the first is that each time a layer is switched on/off or zoom in/out, a big GetMap request (what about 10 layers?) must be done and takes more time than usual. <br>
The problem of the second one is that the more layer we add on the top of an openlayer application, the more the application slow down. <br><br>In terms of performance, which is the best option? <br><br>thanks! <br>Pere Roca</span><br clear="all">
<br>-- <br>Pere Roca Ristol<br>Biòleg i especialista GIS<br>Museo Nacional de Ciencias Naturales (CSIC)<br><br>