[mapserver-users] Changing to Layers.WMS from Layers.Mapserver - Error 'msWMSLoadGetMapParams(): WMS '

Paul Curran paul_everton at hotmail.com
Fri Jul 17 06:49:05 PDT 2009


Ive implemented your changes but im still getting the msWMSLoadGetMapParams(): WMS Server Error message repeatedly thorughout the open layers map window.

 

My map file now looks like this (i have hihglighted your changes in bold), do you think i have put them in correclty? 

 

Cheers

 

MAP
    
    NAME UK1
    SIZE 1600 1200
    IMAGECOLOR  153 204 255
    IMAGETYPE JPEG
    SHAPEPATH "http://localhost/openlayers/data/"
    EXTENT  -888385.321101 -31000.000000 1548385.321101 1271000.000000
    UNITS METERS
   
            
            WEB
              TEMPLATE "http://localhost/openlayers/examples/test.html"
              LOG "\ms4w\tmp\ms_tmp\log.txt"
      IMAGEPATH "\ms4w\tmp\ms_tmp\"
      IMAGEURL "/ms_tmp/"
      METADATA
        'wms_srs' "EPSG:32119 EPSG:4326"
      END
            END
 
  LAYER
  
               NAME "UK"
               STATUS DEFAULT
               TYPE raster
               TILEINDEX "map"
               TILEITEM "Location"
               CLASS
                 STYLE
                  COLOR 0 0 0
                 END
                 LABEL
                  COLOR 0 0 0
                  SIZE SMALL
                 END
                   
               END
               PROJECTION
               "init=epsg:28992"
               END
 
  END
 
  
 
END
 
 
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>MAPPING TEST
    <style type="text/css">
        #map {
            width: 90%;
            height: 90%;
            border: 8px solid black;
        }
    </style>
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
 
      var zoom = 1;
      var bounds = new OpenLayers.Bounds(-888385.321101, -31000.000000, 1548385.321101, 1271000.000000);      
      var map, layer;
      
      function init(){
      map = new OpenLayers.Map('map', { maxExtent: bounds });
      map.addControl(new OpenLayers.Control.PanZoomBar());
      map.addControl(new OpenLayers.Control.OverviewMap());
      map.addControl(new OpenLayers.Control.MousePosition());
      layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
      "http://127.0.0.1/cgi-bin/mapserv.exe?", { layers: 'basic', map: '/ms4w/apps/openlayers-2.5/data/uk1.map', projection: "EPSG:32119" },
      { gutter: 15 });      
      map.addLayer(layer);
      map.zoomToExtent(bounds);
      map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);      
      
      }
 
    </script>
  </head>
  <body onload="init()">
    <div id="map"></div>
  </body>
</html>
 

 
> Date: Fri, 17 Jul 2009 15:29:03 +0200
> Subject: RE: [mapserver-users] Changing to Layers.WMS from Layers.Mapserver
> From: bartvde at osgis.nl
> To: paul_everton at hotmail.com
> CC: mapserver-users at lists.osgeo.org
> 
> Almost,
> 
> PROJECTION
> "init=epsg:28992"
> END
> 
> Best regards,
> Bart
> 
> >
> > Thanks for the quick reply.
> >
> >
> >
> > You mentioned adding a projection block to the layer.
> >
> >
> >
> > Is that done by the following:
> >
> >
> >
> > PROJECTION
> >
> > "epsg:32119"
> >
> > END
> >
> >
> >
> > Thanks again
> >
> >> Date: Fri, 17 Jul 2009 13:22:04 +0200
> >> Subject: Re: [mapserver-users] Changing to Layers.WMS from
> >> Layers.Mapserver
> >> From: bartvde at osgis.nl
> >> To: paul_everton at hotmail.com
> >> CC: mapserver-users at lists.osgeo.org
> >>
> >> Hi,
> >>
> >> there are several things wrong here.
> >>
> >> 'wms_srs' "epsg: 32119 epsg: 4326"
> >>
> >> should be (uppercase EPSG for METADATA and no space in between):
> >>
> >> 'wms_srs' "EPSG:32119 EPSG:4326"
> >>
> >> however Mapserver cannot reproject your data if you do not add a
> >> PROJECTION block to your LAYER stating the projection in which your data
> >> resides.
> >>
> >> Also, in OpenLayers the syntax is (your map can only be in 1
> >> projection):
> >>
> >> {projection: "EPSG:32119"}
> >>
> >> Best regards,
> >> Bart
> >>
> >> >
> >> > Hi, i am having trouble trying to display my map in Open Layers via
> >> > OpenLayers.Layer.wms.
> >> >
> >> >
> >> > Firstly I Built a shape file of the UK as a raster tileindex. I can
> >> now
> >> > view my map via "//localhost/cgi-bin/mapserv.exe/mymapfile.map" and
> >> the
> >> > map looks fine.
> >> > I am now trying to view my map via OpenLayers. Firstly I used
> >> > Openlayers.Layer.MapServer which displayed my map however zoomed in
> >> very
> >> > close. However I have read Layer.Mapserver should be avoided and
> >> Layer.WMS
> >> > should be used instead.
> >> >
> >> > I attempted to amend both my map and openlayers files to display via
> >> WMS
> >> > by
> >> > Including:
> >> >
> >> > METADATA
> >> > ‘wms_srs’ “EPSG: 32119 EPSG: 4326”
> >> > END
> >> > within the WEB section of my map file and adding OpenLayers.WMS within
> >> my
> >> > OpenLayers file.
> >> >
> >> >
> >> > However I now get the following error message within the openlayers
> >> map
> >> > window “msWMSLoadGetMapParams(): WMS Server Error”
> >> >
> >> > I also added ‘projection: "epsg: 32119 epsg:4326” into my openlayers
> >> file
> >> > which hasn’t made any difference
> >> >
> >> > Does anyone have any idea where I am going wrong? Any help greatly
> >> > appreciated. My map and openlayers files are below.
> >> >
> >> > Cheers
> >> >
> >> > p.s. I ahve installed ms4w on windows which i tihnk supports WMS
> >> >
> >> > MAP
> >> >
> >> > NAME UK1
> >> > SIZE 1600 1200
> >> > IMAGECOLOR 153 204 255
> >> > IMAGETYPE JPEG
> >> > SHAPEPATH "http://localhost/openlayers/data/"
> >> > EXTENT -888385.321101 -31000.000000 1548385.321101 1271000.000000
> >> > UNITS METERS
> >> >
> >> > WEB
> >> > TEMPLATE "http://localhost/openlayers/examples/test.html"
> >> > LOG "\ms4w\tmp\ms_tmp\log.txt"
> >> > IMAGEPATH "\ms4w\tmp\ms_tmp\"
> >> > IMAGEURL "/ms_tmp/"
> >> > METADATA
> >> > 'wms_srs' "epsg: 32119 epsg: 4326"
> >> > END
> >> > END
> >> >
> >> > LAYER
> >> >
> >> > NAME "UK"
> >> > STATUS DEFAULT
> >> > TYPE raster
> >> > TILEINDEX "map"
> >> > TILEITEM "Location"
> >> > CLASS
> >> > STYLE
> >> > COLOR 0 0 0
> >> > END
> >> > LABEL
> >> > COLOR 0 0 0
> >> > SIZE SMALL
> >> > END
> >> > END
> >> >
> >> > END
> >> > END
> >> >
> >> > <html xmlns="http://www.w3.org/1999/xhtml">
> >> > <head>MAPPING TEST
> >> > <style type="text/css">
> >> > #map {
> >> > width: 95%;
> >> > height: 95%;
> >> > border: 10px solid black;
> >> > }
> >> > </style>
> >> > <script src="../lib/OpenLayers.js"></script>
> >> > <script type="text/javascript">
> >> >
> >> > var zoom = 1;
> >> > var bounds = new OpenLayers.Bounds(-888385.321101, -31000.000000,
> >> > 1548385.321101, 1271000.000000);
> >> > var map, layer;
> >> >
> >> > function init(){
> >> > map = new OpenLayers.Map('map', { maxExtent: bounds });
> >> > map.addControl(new OpenLayers.Control.PanZoomBar());
> >> > map.addControl(new OpenLayers.Control.OverviewMap());
> >> > map.addControl(new OpenLayers.Control.MousePosition());
> >> > layer = new OpenLayers.Layer.WMS ( "OpenLayers WMS",
> >> > "http://127.0.0.1/cgi-bin/mapserv.exe?", { layers: 'basic', map:
> >> > '/ms4w/apps/openlayers-2.5/data/uk1.map', projection: "epsg “32119
> >> > epsg:4326" },
> >> > { gutter: 15 });
> >> > map.addLayer(layer);
> >> > map.zoomToExtent(bounds);
> >> > map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
> >> >
> >> > }
> >> >
> >> > </script>
> >> > </head>
> >> > <body onload="init()">
> >> > <div id="map"></div>
> >> > </body>
> >> > </html>
> >> > _________________________________________________________________
> >> > Share your photos with Windows Live Photos – Free.
> >> > http://clk.atdmt.com/UKM/go/134665338/direct/01/_______________________________________________
> >> > mapserver-users mailing list
> >> > mapserver-users at lists.osgeo.org
> >> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >> >
> >>
> >>
> >
> > _________________________________________________________________
> > Share your photos with Windows Live Photos – Free.
> > http://clk.atdmt.com/UKM/go/134665338/direct/01/_______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> 
> 

_________________________________________________________________
Share your photos with Windows Live Photos – Free.
http://clk.atdmt.com/UKM/go/134665338/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090717/8035deac/attachment.htm>


More information about the MapServer-users mailing list