<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><BR>Richard, that was a huge help. It didn't dawn on me to look at that example, but it helps very much.<BR>
<BR>
Thanks for your help!<BR><BR>David<BR><BR>
<HR id=stopSpelling>
<BR>
> Date: Fri, 9 Nov 2007 18:13:44 +0100<BR>> From: rdmailings@duif.net<BR>> To: drkmattr@hotmail.com<BR>> CC: users@openlayers.org<BR>> Subject: Re: [OpenLayers-Users] Getting up and running with OpenLayers<BR>> <BR>> Hi David,<BR>> <BR>> the error you see is because openlayers is asking for a layer in the <BR>> epsg:4326 (default latlon) projection.<BR>> <BR>> You can do two things:<BR>> - either add EPSG:4326 to your WMS_SRS "EPSG:32616" line in the WEB part <BR>> of your mapserver map file<BR>> if your mapserver and proj lib are ok, this will make mapserver project <BR>> your 32616 data to 4326 and you will see latlon projected maps in OL.<BR>> <BR>> But probably you want to see 32616 projected maps, you can do that by <BR>> telling OL that the Map's projection is 32616: something like this:<BR>> <BR>> map = new OpenLayers.Map('map', {<BR>> 'projection':'EPSG:32616',<BR>> 'units':'m',<BR>> 'maxExtent':new OpenLayers.Bounds(582919,4182989,610195,4207241),<BR>> });<BR>> <BR>> hope this helps something.<BR>> <BR>> grtz,<BR>> Richard Duivenvoorde<BR>> <BR>> ps have also a look at<BR>> http://www.openlayers.org/dev/examples/projected-map.html<BR>> <BR>> <BR>> <BR>> <BR>> drk mattr wrote:<BR>> > I've been reading about OpenLayers on James Fee's blog and I'm really <BR>> > interested in working with it. I'm a long time ArcIMS developer so the <BR>> > concepts here are close to what I'm used to using (well I'm not used to <BR>> > using JavaScript which is my problem).<BR>> > <BR>> > I've got a mapfile up and running.<BR>> > <BR>> > MAP<BR>> > NAME Installation<BR>> > SIZE 800 500<BR>> > IMAGECOLOR 240 240 240<BR>> > EXTENT 582919.88200 4182989.235900 610195.822000 4207241.321900<BR>> > UNITS METERS<BR>> > PROJECTION<BR>> > "init=EPSG:32616"<BR>> > END<BR>> > WEB<BR>> > IMAGEPATH "/ms4w/tmp/ms_tmp/"<BR>> > IMAGEURL "/ms_tmp/"<BR>> > METADATA<BR>> > WMS_TITLE "WMS Test"<BR>> > WMS_ABSTRACT "My attempt at actually moving from ArcIMS to WMS"<BR>> > WMS_ACCESSCONSTRAINTS "none"<BR>> > <BR>> > WMS_ONLINERESOURCE "http://localhost:8080/test/test.html"<BR>> > WMS_SRS "EPSG:32616"<BR>> > END<BR>> > END<BR>> > <BR>> > LAYER<BR>> > NAME "Installation"<BR>> > TYPE POLYGON<BR>> > STATUS DEFAULT<BR>> > DATA "Installation_Area.shp"<BR>> > <BR>> > CLASS<BR>> > NAME 'Installation'<BR>> > OUTLINECOLOR 60 60 60<BR>> > COLOR 255 255 0<BR>> > SYMBOL 0<BR>> > END<BR>> > END <BR>> > END<BR>> > <BR>> > Which returns a simple map when I test it: <BR>> > _http://localhost:8080/cgi-bin/mapserv.exe?MAP=/ms4w/apache/htdocs/test/test.map&mode=map_ <BR>> > <http://localhost:8080/cgi-bin/mapserv.exe?MAP=/ms4w/apache/htdocs/test/test.map&mode=map><BR>> > <BR>> > Now, I've decided to try OpenLayers and this is my code which I borrowed <BR>> > from one of the examples:<BR>> > <BR>> > <html xmlns="http://www.w3.org/1999/xhtml"><BR>> > <head><BR>> > <style type="text/css"><BR>> > #map {<BR>> > width: 800px;<BR>> > height: 475px;<BR>> > border: 1px solid black;<BR>> > }<BR>> > </style><BR>> > <script src="OpenLayers.js"></script><BR>> > <script type="text/javascript"><BR>> > function init(){<BR>> > map = new OpenLayers.Map( 'map' );<BR>> > layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",<BR>> > <BR>> > "http://localhost:8080/cgi-bin/mapserv.exe?MAP=/ms4w/apache/htdocs/test/test.map", <BR>> > {layers: 'Installation'} );<BR>> > map.addLayer(layer);<BR>> > }<BR>> > </script><BR>> > </head><BR>> > <body onload="init()"><BR>> > <div id="map"></div><BR>> > </body><BR>> > </html><BR>> > <BR>> > When I run it, I get a tiles which say:<BR>> > <BR>> > msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must <BR>> > be valid for all requested layers.<BR>> > <BR>> > Now I looked at the doc and it seems like you can set the projection <BR>> > which I tried, but it still returned the same error. I'm sure I'm <BR>> > close, but I'm just a little out of my league right now with openlayers.<BR>> > <BR>> > Any help would be greatly appreciated.<BR>> > <BR>> > David.<BR>> > <BR>> > <BR>> > <BR>> > <BR>> > ------------------------------------------------------------------------<BR>> > Peek-a-boo FREE Tricks & Treats for You! Get 'em! <BR>> > <http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us><BR>> > <BR>> > <BR>> > ------------------------------------------------------------------------<BR>> > <BR>> > _______________________________________________<BR>> > Users mailing list<BR>> > Users@openlayers.org<BR>> > http://openlayers.org/mailman/listinfo/users<BR>> <BR><BR><br /><hr />Help yourself to FREE treats served up daily at the Messenger Café. <a href='http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline' target='_new'>Stop by today!</a></body>
</html>