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