[OpenLayers-Users] How to change this layers.apServer to layer.WMS

Gregor at HostGIS gregor at hostgis.com
Sun Apr 5 16:11:37 EDT 2009


> var layer = new OpenLayers.Layer.MapServer( "Østfoldkart",
>        "http://naturkart.no/cgi-bin/mapserv", {map: 
> '/Library/WebServer/Documents/Naturkart/kulturminnekart/apps/demo/shapeostfold.map'},
>        {gutter:15} );

WMS doesn't take a "map" param; you'd have to include it in the URL, 
like this. You would then have to specify the layers:

"http://naturkart.no/cgi-bin/mapserv?map=/path/to/mapfie.map&",
{ layers:'layer1,layer2' }

If you're not familiar with WMS, I'd recommend reading MapServer's 
tutorial on "WMS Servers in MapServer" It's a quick read, but should 
answer all your questions.

-- 
HostGIS, Open Source solutions for the global GIS community
Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
Network+   Server+   A+   Security+



More information about the Users mailing list