Ozgur,<div><br></div><div>You said that layers are BASE layers. Base layers can&#39;t switch to off an on, there is only one base layer active, there you can switch between them. Are you using the OpenLayers.Control.LayerSwitcher, to see the layers? </div>
<div><br></div><div>In the openlayers.layer.wms you can set this as not a base layer, as options.. after {}, { isBaseLayer: false }</div><div>But remember a base layer need to exist, and there is a way to include a &#39;blank&#39; layer as base layer.</div>
<div><br></div><div>Good luck,<br clear="all"><img src="http://globalgeo.com.br/assinaturas/fernando.gif"><br><br>
<br><br><div class="gmail_quote">2012/4/9 Özgür Arslan <span dir="ltr">&lt;<a href="mailto:ozgurarslan81@hotmail.com">ozgurarslan81@hotmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr">



<div dir="ltr">     Hi ALL,<br><br>Thanks for all responds. I tryed all suggestions and when I use these lines it only shows layer1 like a base map and I can&#39;t switch off and on. I would like create 3 separate layer that I can switch off and on each layer individually.<br>
<pre>Furthermore when I change the layer orders from <font color="#C00000">map.addLayers([layer1,layer2,layer3]);</font> to <font color="#FF0000">map.addLayers([layer2,layer1,layer3]);</font> this time it only shows <br>the second layer(layer2) as a base layer and I can&#39;t switch off and on. Could you please share your ideas with me about the issue?<br>
<br>Thank you<br><br> <br>layer1 = new OpenLayers.Layer.WMS( &quot;QGIS-MAP&quot;,&quot;<br>&gt; <a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>&quot;, {layers:<br>&gt; &#39;ResidentDistrict_2011&#39;,map:<br>
&gt; &#39;/wwwroot/example1_test/Canada_Mountains.map&#39;,} )<br>&gt;<br>&gt; layer2 = new OpenLayers.Layer.WMS( &quot;QGIS-MAP&quot;,&quot;<br>&gt; <a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>&quot;, {layers: &#39;LAKES&#39;,map:<br>
&gt; &#39;/wwwroot/example1_test/Canada_Mountains.map&#39;,} )<br>&gt;<br>&gt; layer3 = new OpenLayers.Layer.WMS( &quot;QGIS-MAP&quot;,&quot;<br>&gt; <a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>&quot;, {layers: &#39;BDI_2011&#39;,map:<br>
&gt; &#39;/wwwroot/example1_test/Canada_Mountains.map&#39;,} )<br>&gt;<br>&gt; map.addLayers([layer1,layer2,layer3]);<br><br><br><u>here are the html codes</u><br><br><br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;title&gt;OpenLayers Example&lt;/title&gt;<br>
   &lt;link rel=&quot;stylesheet&quot; href=&quot;openlayers/theme/default/style.css&quot; type=&quot;text/css&quot;&gt;<br>

    &lt;script src=&quot;<a href="http://openlayers.org/api/OpenLayers.js" target="_blank">http://openlayers.org/api/OpenLayers.js</a>&quot;&gt;&lt;/script&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>      &lt;center&gt;&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;&lt;/center&gt;<br>


      &lt;style&gt;<br>    @media screen<br>    {<br>        #map{width:975px; height:750px; border: 2px solid black;}<br>    }<br>    &lt;/style&gt;<br>      &lt;script defer=&quot;defer&quot; type=&quot;text/javascript&quot;&gt;<br>


        var lon = -84.722147;<br>        var lat = 49.298594;    <br>     <br>        var zoom = 6;<br>        var map, layer;<br>      <br>        map = new OpenLayers.Map(&#39;map&#39;);<br>        layer = new OpenLayers.Layer.WMS( &quot;QGIS-MAP&quot;,<br>


            &quot;<a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>&quot;, {layers: &#39;ResidentDistrict_2011,LAKES,BDI_2011&#39;,map: &#39;/wwwroot/example1_test/Canada_Mountains.map&#39;,} )<br>


        <br>        map.addLayer(layer);<br>        map.zoomToMaxExtent();  <br>        map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);<br>        <br>        map.addControl(new OpenLayers.Control.PanZoomBar());<br>


        map.addControl(new OpenLayers.Control.MouseToolbar());<br>        map.addControl(new OpenLayers.Control.LayerSwitcher());<br>        map.addControl(new OpenLayers.Control.MousePosition());<br>        map.addControl(new OpenLayers.Control.OverviewMap());<br>


      &lt;/script&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;<br></pre></div>
                                               </div></div>
<br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br></div>