[OpenLayers-Users] Control access to WMS

Daniel Morissette dmorissette at mapgears.com
Wed Oct 14 14:31:26 EDT 2009


Steve.Toutant at inspq.qc.ca wrote:
> I'm using OpenLayers to create a WMS layer with new 
> OpenLayers.Layer.WMS(name, url, params, options);
> Instead of the path of the mapfile should I use MYMAP (Environment 
> variable MYMAP defined in the conf of Apache). 


There is nothing to change in your mapfile. All you need to do is edit 
the value of your WMS 'url' parameter in the OpenLayers layer creation 
call to use map=MYMAP in the URL instead of the full path to the mapfile.


> If so, Is there some 
> magic there to get the environment variable value? Should I get it with 
> some php code?
> 

There is no PHP or other scripting required. All the magic for this is 
already built into MapServer.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the Users mailing list