[OpenLayers-Users] Call Mapfile layer with Openlayers when status
ON or OFF
Paul Curran
paulcurran9 at googlemail.com
Wed Sep 9 07:44:07 EDT 2009
Hi
I can view my UK Layer via Mapserver with the following
url: 'ms4w/cgi-bin/mapserv.exe?mode=map&map=c:mapdirectory*&layer=uk'.* The
*&layer=uk *is calling my layer.
However I can’t find any documentation on how to call the layer when viewing
my map within OpenLayers.
I am currently trying to call the layer like this:
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: "uk", map:
'/ms4w/apps/openlayers-2.5/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: "250", map:
'/ms4w/apps/openlayers-2.5/data/uk2.map',
minZoomLevel: 5, maxZoomLevel: 10},
{ gutter: 15 });
map.addLayer(uk, 250);
map.zoomToExtent(bounds);
map.setCenter(bounds);
map.zoomToMaxExtent();
However I am just seeing pink tiles within OpenLayers.
Note: If my layers are set to default within my Mapfile all my layers are
displayed.
Thanks for any help in advance
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090909/84b25cdb/attachment.html
More information about the Users
mailing list