<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi, If anyone can help would be greatly appreciated i have been have 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 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' '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 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="<A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><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, 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> "<A href="http://127.0.0.1/cgi-bin/mapserv.exe">http://127.0.0.1/cgi-bin/mapserv.exe</A>", { layers: 'basic', map: '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 /><hr />
Upgrade to Internet Explorer 8 Optimised for MSN. <a href='http://extras.uk.msn.com/internet-explorer-8/?ocid=T010MSN07A0716U' target='_new'>Download Now</a></body>
</html>