<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=531125217-27102009>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=531125217-27102009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=531125217-27102009>you have added <FONT face="Times New Roman" 
color=#000000 size=3>minZoomLevel and maxZoomLevel to the params or your WMS 
layer. params are used for building the WMS request. Move them to the options of 
your WMS layer and perhaps it works. I use minScale and maxScale to control the 
display of layers.</FONT></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=531125217-27102009></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=531125217-27102009>{&nbsp;&nbsp;gutter:15,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT><SPAN class=531125217-27102009>&nbsp;&nbsp; 
minZoomLevel&nbsp;: 5,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT><SPAN class=531125217-27102009>&nbsp;&nbsp; 
maxZoomLevel : 10</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;&nbsp;<SPAN class=531125217-27102009>//</SPAN>minScale : 
1000000,<BR>&nbsp;&nbsp;&nbsp;<SPAN class=531125217-27102009>//</SPAN>maxScale : 
45000</FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=531125217-27102009></SPAN>}<BR></FONT></FONT></FONT></DIV><SPAN 
class=531125217-27102009></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>Arnd<SPAN class=531125217-27102009></SPAN></FONT></FONT></FONT><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Paul 
Curran<BR><B>Gesendet:</B> Dienstag, 27. Oktober 2009 16:08<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Display WMS layer 
depending on ZoomLevel<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Hello i need your help.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I currently have two layers. i would like to display one layer initially 
then zoom in closer and display the second layer. I have been trying to do it 
like this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>var options = { maxExtent: bounds, maxResolution: 600, numZoomLevels: 
10};<BR>&nbsp;<BR>layer1 = new OpenLayers.Layer.WMS("OpenLayers WMS", <BR>"<A 
href="http://127.0.0.1/cgi-bin/mapserv.exe">http://127.0.0.1/cgi-bin/mapserv.exe</A>?", 
{ layers: "uk", map: '/ms4w/apps/openlayers-2.5/data/uk2.map', <BR>minZoomLevel: 
1, maxZoomLevel: 4 },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { gutter: 15 
});<BR>&nbsp;<BR>&nbsp;<BR>layer2 = new OpenLayers.Layer.WMS("OpenLayers 
WMS",<BR>"<A 
href="http://127.0.0.1/cgi-bin/mapserv.exe">http://127.0.0.1/cgi-bin/mapserv.exe</A>?", 
{ layers: "UK250", map: '/ms4w/apps/openlayers-2.5/data/uk2.map', 
<BR>minZoomLevel: 5, maxZoomLevel: 10},<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { 
gutter: 15 });<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(Layer1, 
Layer2);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.zoomToExtent(bounds);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.setCenter(bounds);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.zoomToMaxExtent();</DIV>
<DIV>&nbsp;</DIV>
<DIV>My main problem is&nbsp;i can only display a layer when status is DEFAULT 
within mapfile however i cannot hide the layer if set to this. When Set to ON 
the layer is not displayed atall.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any help much appreciated</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV></BODY></HTML>