<html><body bgcolor="#FFFFFF"><div>Thanks for the response. Has this worked for you with status of layer set to DEFAULT or ON?</div><div><br></div><div>Cheers<br><br>Sent from my iPhone</div><div><br>On 27 Oct 2009, at 18:00, "Arnd Wippermann" <<a href="mailto:arnd.wippermann@web.de">arnd.wippermann@web.de</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>
<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> <a href="mailto:users-bounces@openlayers.org">users-bounces@openlayers.org</a>
[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>
<a href="mailto:users@openlayers.org"><a href="mailto:users@openlayers.org">users@openlayers.org</a></a><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"><a href="http://127.0.0.1/cgi-bin/mapserv.exe">http://127.0.0.1/cgi-bin/mapserv.exe</a></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"><a href="http://127.0.0.1/cgi-bin/mapserv.exe">http://127.0.0.1/cgi-bin/mapserv.exe</a></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>
</div></blockquote></body></html>