[OpenLayers-Users] [newbie] Different projections, Mapserver as WMS

Julien-Samuel Lacroix jlacroix at mapgears.com
Fri Jan 11 13:02:01 EST 2008


Hi,

Your MapServer layer probably doesn't support the EPSG:4326 projection. 
To make it support this projection, you must specify it in the wms_srs 
metadata in your mapfile.

This metadata list all SRS available for the layer. See the wms_srs 
metadata explanation here:
http://mapserver.gis.umn.edu/docs/howto/wms_server/#setup-a-mapfile-for-your-wms

Julien

Cranio wrote:
> Hi you all! I'm an absolute beginner so I hope that you'll have some
> patience.
> 
> What I am trying to do is to have two layers on an Openlayers map.
> 
> The FIRST layer is the OpenLayers WMS that we can found in many examples.
> I believe it relies on a "EPSG:4326" projection, right?
> 
> var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
>         "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
> 
> Then, the SECOND layer is a MapServer layer that uses "EPSG:26592" that I
> define this way:
> 
> var my_wms = new OpenLayers.Layer.WMS( "Apulia",
> "http://my.domain.net/cgi-bin/mapserv?map=/var/www/path-to-mapfile/mymapfile.map",
>   {layers: "comuni", transparent: "true", format: "image/png" });
> 
> But it doesn't work... If I change the projection of the map defining the
> map as:
> 
> var map = new OpenLayers.Map('map',{projection:"EPSG:26592"});
> 
> the 2nd layers gives no error but the bounds are totally wrong, and i lose
> 1st layer.
> If i leave the default proj for map, EPSG:4326, the 1st layer works but
> the 2nd gives me an error (SRS).
> 
> Any help will be appreciated! Please lemme know if you need some more info
> (f.ex. the MapServer mapfile or things like that).
> 

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/



More information about the Users mailing list