[mapserver-users] Meaning of PROJECTION and WMS - using OpenLayers

Robert Sanson Robert.Sanson at asurequality.com
Wed Aug 10 20:06:50 EDT 2011


Dear Michael
 
You need to tell OL which projection to request in within the map object. This is how I do it:
 
var mapoptions = {
      maxExtent: new OpenLayers.Bounds(773500, 4555450, 2602100, 6384050),
      units: 'm',
      projection: "EPSG:2193",
    };
    map = new OpenLayers.Map( 'map',mapoptions );
 
Then my layer is something like this:
 
var topochwms = new OpenLayers.Layer.WMS( "Topos (Chathams)",
                    "http://myserver/cgi-bin/gsswms.exe?",
                    {layers: ['ci250k','ci50kcitm'], transparent: 'true',format: "image/png"},
                    {singleTile: true, isBaseLayer: true, visibility: true} );
map.addLayer(topochwms);
 
regards,
 
Robert

>>> "Michael G." <michael.gajda at tu-dortmund.de> 11/08/2011 11:41 a.m. >>>
Hi,

since a couple of days we try visualize data from a postgis database using
mapserver and openlayers. As far as we know is our postgis data in EPSG:25832
and our mapfile for mapserver looks like this:

http://dpaste.com/hold/591626/ 

Now we have created an index.html containing the following JS snippet:

http://dpaste.com/hold/591627/ 

We can test the WMS using a direct WMS URL to our MapServer and asking for
EPSG:25832 and the correct extends, and it displays the map just fine
(Everything is protected so I cannot provide this URL here).

If we try to display the map using the openlayers code above we do not see
anything at all. You can zoom and move it around but that's
everthing you get with openlayers. Networkdebugging tools tell me, that
OpenLayers by default is requesting that google projection of EPSG:3867. But
even providing coordinates that should somehow be in Dortmund it does only
display the backgroundcolor.

Maybe you can help me clearing up a few things. Like the list of projections
in 'wms_srs' is what MapServer provides via WMS. And the PROJECTION entry on
the 'LAYER' level should be set to the projection of my data. Correct? And
the PROJECTION on the MAP level is ignored? Does MapServer automatically
convert the coordinates? MapServer requires to have EXTEND set. Which
projection should I use? The one defined at MAP level?

Best regards,
Michael
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users


This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system.

This message has been scanned for Malware and Viruses by Websense Hosted Security.
www.websense.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110811/d3bb5a77/attachment.html


More information about the mapserver-users mailing list