<p>Hi,<br> <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>
<br>Am i going about this the correct way by having two variables 'layer1 and 'layer2' for layers from the same mapfile?<br> <br>Currently my code is as follows<br> <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> <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>
{ gutter: 15 });<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: "uk", map: '/ms4w/apps/openlayers-2.8/data/uk2.map', minZoomLevel: 5, maxZoomLevel: 10 },<br>
{ gutter: 15 });<br> <br>map.addLayer(layer1, layer2);<br> <br>Thanks for any help in advance</p>
<p><br>Paul</p>