[OpenLayers-Dev] Projection-error on WMS-service

Michael Östling michael.ostling at metagis.se
Mon Jul 16 03:43:31 EDT 2007


Hi,
I have problems to get OpenLayers understanding any other projection than
wgs84 (epsg:4324) when calling a WMS-layer
 
I have an WMS-services created with Mapserver.
The services has a SRS with epsg-code 2400.
I can verify the the service and the projection in Carbon tools
OGC-Analyzer.
 
I then try to show this in OpenLayers with the html-code shown in the bottom
of the eMail.The code seems not to use my extent information and the
WMS-epsg code.
When looking into the apache-logfile I can see that my boundingbox and SRC
is skipped and instead replaced by epsg:4326 and boundingbox with
-180,-90-180,270 ???
 
Mapserver returns  images with the error-text written into it   "
msWMSLoadGetMapParams(): WMS Server Error, Invalid SRS given"
 
Apachelogfile
192.168.1.198 - - [16/Jul/2007:09:21:46 +0200] "GET
/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/sna01.map&LAYERS=markyta&SERVIC
E=WMS&VERSION=1.1.1&REQUEST=GetMap&
STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&
SRS=EPSG%3A4326&BBOX=-180%2C-90%2C180%2C270&WIDTH=256&HEIGHT=256 HTTP/1.1"
200 5424
 
Should I specify the SRC in the OpenLayers also or what wrong am I doing?
 
Regards
Michael
 
 
#HTML-page for opening a WMS-Layer
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
        #map {
            width: 800px;
            height: 475px;
            border: 1px solid black;
        }
    </style>
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        <!--
        var map, layer,bounds;
 
        function init(){
            map = new OpenLayers.Map( $('map') );
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://metagisxp1/cgi-bin/mapserv.exe?map=/ms4w/Apache/htdocs/sna01.map",
{layers: 'markyta'} );
            map.addLayer(layer);
           var bounds = new OpenLayers.Bounds(1200000,6200000, 1900000,
7900000); 
            map.zoomToExtent(bounds);
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
        }
        
        // -->
    </script>
  </head>
  <body onload="init()">
    <div id="map"></div>
  </body>
</html>
 
mvh
Michael

------------------------------------------------------------------
MetaGIS AB 
Michael Östling
Mob: 070-279 19 76
Tel: 023 - 702 20 10
ePost: michael.ostling at metagis.se
Adress: Britsarvsvägen 28a, 791 36 FALUN
Org Nr: 556638-7170
------------------------------------------------------------------

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20070716/850b4cac/attachment.html


More information about the Dev mailing list