<!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><SPAN class=421533121-08092009><FONT face=Arial 
color=#0000ff size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421533121-08092009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=421533121-08092009><FONT face=Arial 
color=#0000ff size=2>from your code both layers should be baselayers. That means 
only one layer would displayed. That seems, that&nbsp;in your mapfile both 
layers have status default.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=421533121-08092009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=421533121-08092009><FONT face=Arial 
color=#0000ff size=2>Arnd</FONT></SPAN></DIV><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, 8. September 2009 23:10<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Display specific 
layer from mapfile<BR></FONT><BR></DIV>
<DIV></DIV>
<P>Hi,<BR>&nbsp;<BR>I am having trouble displaying a specific layer from my 
mapfile. I have two layers called '250' and 'uk'. I wish to display my '250' 
layer origninally, then zoom closer to display my 'uk' layer. however both my 
layers are currenlty displayed at all times.<BR>&nbsp;<BR>Am i going about this 
the correct way by having two variables 'layer1 and 'layer2' for layers from the 
same mapfile?<BR>&nbsp;<BR>Currently my code is as follows<BR>&nbsp;<BR>var 
bounds = new OpenLayers.Bounds(0, 0, 660046, 1229782);<BR>var map, layer1, 
layer2;<BR>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: "250", map: '/ms4w/apps/openlayers-2.8/data/uk2.map', minZoomLevel: 1, 
maxZoomLevel: 4 },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { gutter: 15 
});<BR>&nbsp;<BR>layer2 = new OpenLayers.Layer.WMS("OpenLayers 
WMS",<BR>&nbsp;"<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.8/data/uk2.map', minZoomLevel: 5, 
maxZoomLevel: 10 },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { gutter: 15 
});<BR>&nbsp;<BR>map.addLayer(layer1, layer2);<BR>&nbsp;<BR>Thanks for any help 
in advance</P>
<P><BR>Paul</P></BODY></HTML>