<!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> </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> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=531125217-27102009>{ gutter:15,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT><SPAN class=531125217-27102009>
minZoomLevel : 5,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT><SPAN class=531125217-27102009>
maxZoomLevel : 10</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> <SPAN class=531125217-27102009>//</SPAN>minScale :
1000000,<BR> <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> </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> </DIV>
<DIV>var options = { maxExtent: bounds, maxResolution: 600, numZoomLevels:
10};<BR> <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> { gutter: 15
});<BR> <BR> <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> {
gutter: 15 });<BR> <BR> map.addLayer(Layer1,
Layer2);<BR>
map.zoomToExtent(bounds);<BR>
map.setCenter(bounds);<BR>
map.zoomToMaxExtent();</DIV>
<DIV> </DIV>
<DIV>My main problem is 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> </DIV>
<DIV>Any help much appreciated</DIV>
<DIV> </DIV>
<DIV>Cheers</DIV></BODY></HTML>