<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thanks for your reply.<BR>
<BR>
<BR>
<BR>
I have set up the IMAGEPATH and IMAGE URL as you have suggested and i can now view the outline of my map however it is in red. As you suggested is is probably my projection which i causing this. Any ideas what the correct projection setting might be?<BR>
<BR>
Thanks again<BR>
<BR>
Paul<BR>
<BR>> Date: Mon, 13 Jul 2009 08:17:21 -0600<BR>> From: bfraser@geoanalytic.com<BR>> To: paul_everton@hotmail.com<BR>> CC: mapserver-users@lists.osgeo.org<BR>> Subject: Re: [mapserver-users] .map file wont display in Open Layers<BR>> <BR>> Paul,<BR>> <BR>> You may need to define your output projection instead of using "AUTO" (I <BR>> didn't know mapserver would tolerate that in the MAP section!).<BR>> <BR>> <BR>> And IMAGEPATH is the file-system path to a folder writable by mapserver. Here's <BR>> an example using standard ms4w:<BR>> <BR>> IMAGEPATH '\ms4w\tmp\ms_tmp\'<BR>> <BR>> with IMAGEURL being its web-based equivalent (the same location on disk but <BR>> access via your web server):<BR>> <BR>> IMAGEURL '\ms_tmp\'<BR>> <BR>> since "ms_tmp" is set as an alias in Apache's httd.conf:<BR>> <BR>> Alias /ms_tmp/ "C:/ms4w/tmp/ms_tmp/"<BR>> <BR>> <BR>> Best Regards,<BR>> Brent Fraser<BR>> <BR>> <BR>> Paul Curran wrote:<BR>> > Hi, If anyone can help would be greatly appreciated i have been have <BR>> > difficulties displaying my map in Open Layers for little while now.<BR>> > <BR>> > I have a map file (uk.map) pulling in one layer which is a .shp file <BR>> > consisting of .tiff files i created using FWTools.<BR>> > <BR>> > However i call the .map file from my html page and the map<BR>> > will not display in openlayers just a blank screen within the<BR>> > Open Layers Window. Can anyone see where i am going wrong?<BR>> > <BR>> > Here is my map file<BR>> > <BR>> > MAP<BR>> > NAME ukmap<BR>> > STATUS ON<BR>> > IMAGETYPE PNG<BR>> > IMAGECOLOR 153 204 255<BR>> > # Map image size<BR>> > SIZE 800 800<BR>> > UNITS METERS<BR>> > EXTENT -888385.321101 -31000.000000 1548385.321101 1271000.000000<BR>> > PROJECTION<BR>> > "AUTO"<BR>> > END<BR>> > # Background color for the map canvas -- change as desired<BR>> > IMAGECOLOR 192 192 192<BR>> > IMAGEQUALITY 95<BR>> > IMAGETYPE gif<BR>> > OUTPUTFORMAT<BR>> > NAME gif<BR>> > DRIVER 'GD/GIF'<BR>> > MIMETYPE 'image/gif'<BR>> > #IMAGEMODE PC256<BR>> > EXTENSION 'gif'<BR>> > END<BR>> > # Legend<BR>> > LEGEND<BR>> > IMAGECOLOR 255 255 255<BR>> > STATUS ON<BR>> > KEYSIZE 18 12<BR>> > LABEL<BR>> > TYPE BITMAP<BR>> > SIZE MEDIUM<BR>> > COLOR 0 0 89<BR>> > END<BR>> > END<BR>> > # Web interface definition. Only the template parameter<BR>> > # is required to display a map. See MapServer documentation<BR>> > WEB<BR>> > # Set IMAGEPATH to the path where MapServer should<BR>> > # write its output.<BR>> > IMAGEPATH '/tmp/'<BR>> > # Set IMAGEURL to the url that points to IMAGEPATH<BR>> > # as defined in your web server configuration<BR>> > IMAGEURL '/tmp/'<BR>> > # WMS server settings<BR>> > METADATA<BR>> > 'wms_title' 'ukmap'<BR>> > 'wms_onlineresource' <BR>> > 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'<BR>> > 'wms_srs' 'EPSG:4326'<BR>> > END<BR>> > #Scale range at which web interface will operate<BR>> > # Template and header/footer settings<BR>> > # Only the template parameter is required to display a map. See <BR>> > MapServer documentation<BR>> > END<BR>> > LAYER<BR>> > NAME 'map'<BR>> > TYPE POLYGON<BR>> > DATA 'C:\ms4w\apps\openlayers-2.5\data\map.shp'<BR>> > METADATA<BR>> > 'wms_title' 'map'<BR>> > END<BR>> > STATUS DEFAULT<BR>> > TRANSPARENCY 100<BR>> > PROJECTION<BR>> > 'proj=longlat'<BR>> > 'ellps=WGS84'<BR>> > 'datum=WGS84'<BR>> > 'no_defs'<BR>> > ''<BR>> > END<BR>> > CLASS<BR>> > NAME 'map'<BR>> > STYLE<BR>> > SYMBOL 0<BR>> > SIZE 2<BR>> > OUTLINECOLOR 0 0 0<BR>> > COLOR 144 50 207<BR>> > END<BR>> > END<BR>> > END<BR>> > END<BR>> > <BR>> > And my html page:<BR>> > <BR>> > <html xmlns="http://www.w3.org/1999/xhtml"><BR>> > <head><B><i>NARIMS MAPPING TEST</i></B><BR>> > <style type="text/css"><BR>> > #map {<BR>> > width: 800px;<BR>> > height: 475px;<BR>> > border: 1px solid black;<BR>> > }<BR>> > </style><BR>> > <script src="../lib/OpenLayers.js"></script><BR>> > <script type="text/javascript"><BR>> > <BR>> > var lon = 5;<BR>> > var lat = 40;<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.MouseToolbar());<BR>> > map.addControl(new OpenLayers.Control.MousePosition());<BR>> > map.addControl(new OpenLayers.Control.OverviewMap());<BR>> > <BR>> > <BR>> > layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS",<BR>> > "http://127.0.0.1/cgi-bin/mapserv.exe", { layers: 'basic', map: <BR>> > 'c:/ms4w/apps/openlayers-2.5/data/uk.map' }, { gutter: 15 }); <BR>> > map.addLayer(layer);<BR>> > map.zoomToExtent(bounds);<BR>> > map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); <BR>> > <BR>> > }<BR>> > </script><BR>> > </head><BR>> > <body onload="init()"><BR>> > <div id="map"></div><BR>> > </body><BR>> > </html><BR>> > <BR>> > <BR>> > Any help much appreciated. Thanks in advance<BR>> > <BR>> > <BR>> > <BR>> > <BR>> > ------------------------------------------------------------------------<BR>> > Upgrade to Internet Explorer 8 Optimised for MSN. Download Now <BR>> > <http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U><BR>> > <BR>> > <BR>> > ------------------------------------------------------------------------<BR>> > <BR>> > _______________________________________________<BR>> > mapserver-users mailing list<BR>> > mapserver-users@lists.osgeo.org<BR>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users<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>