Hi,
 
from your code both layers should be baselayers. That means only one layer
would displayed. That seems, that in your mapfile both layers have status
default.
 
Arnd

  _____  

Von: [email protected] [mailto:[email protected]] Im
Auftrag von Paul Curran
Gesendet: Dienstag, 8. September 2009 23:10
An: [email protected]
Betreff: [OpenLayers-Users] Display specific layer from mapfile



Hi,
 
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.
 
Am i going about this the correct way by having two variables 'layer1 and
'layer2' for layers from the same mapfile?
 
Currently my code is as follows
 
var bounds = new OpenLayers.Bounds(0, 0, 660046, 1229782);
var map, layer1, layer2;
var options = { maxExtent: bounds, maxResolution: 600, numZoomLevels: 10};
 
layer1 = new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://127.0.0.1/cgi-bin/mapserv.exe?";, { layers: "250", map:
'/ms4w/apps/openlayers-2.8/data/uk2.map', minZoomLevel: 1, maxZoomLevel: 4
},
      { gutter: 15 });
 
layer2 = new OpenLayers.Layer.WMS("OpenLayers WMS",
 "http://127.0.0.1/cgi-bin/mapserv.exe?";, { layers: "uk", map:
'/ms4w/apps/openlayers-2.8/data/uk2.map', minZoomLevel: 5, maxZoomLevel: 10
},
      { gutter: 15 });
 
map.addLayer(layer1, layer2);
 
Thanks for any help in advance


Paul

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to