Take a look at these 5 lines from your map file: <br><br> EXTENT -8000000 300000 5000000 1500000<br>
UNITS METERS<br>
PROJECTION<br>
"proj=latlong" "lat_1=32" "lat_2=44" "lat_0=38" "lon_0=-100" "x_0=0" "y_0=0" "ellps=GRS80" "datum=NAD83"<br>
END<br><br>You are telling MapServer that your image extent is 13 million degrees in the x direction. <br><br>Your EXTENT and UNITS need to be of the same units as your output projection. <br><br>Try UNITS "dd" and convert your extent to degrees.<br>
<br>David.<br><br><div class="gmail_quote">On Tue, Apr 15, 2008 at 3:06 PM, <<a href="mailto:ptang83@yahoo.com">ptang83@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
I downloaded a demo which display a nice map through mapserver. The image is like this.<br>
<a href="http://www.mobilegeographics.com/mapserver/usa1.phtml" target="_blank">http://www.mobilegeographics.com/mapserver/usa1.phtml</a><br>
<br>
The image is big and nice.<br>
<br>
When I changed it to display throught openlayers. The openlayer map only display a blank windows with all controls. If I change the "proj=lcc" to "proj=latlong" , then it display a map but the size of the map is very small and only occupied the upper lift corner of the openlayers div. Is there any way to make display fit the windows?<br>
<br>
Would like to take any suggestion. Thanks in advance!<br>
<br>
=========<br>
usa1.html<br>
===========<br>
<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"><br>
<head><br>
// <title>My Test MapServer Layer</title><br>
<style type="text/css"><br>
#map {<br>
width: 800px;<br>
height: 500px;<br>
border: 1px solid black;<br>
}<br>
</style><br>
<br>
<script type="text/javascript" src="<a href="http://clients.multimap.com/API/maps/1.1/metacarta_04" target="_blank">http://clients.multimap.com/API/maps/1.1/metacarta_04</a>"></script><br>
<br>
<script src="<a href="http://openlayers.org/dev/lib/OpenLayers.js" target="_blank">http://openlayers.org/dev/lib/OpenLayers.js</a>"></script><br>
<script type="text/javascript"><br>
<!--<br>
var map, layer;<br>
<br>
function init(){<br>
map = new OpenLayers.Map( 'map' );<br>
layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS",<br>
"<a href="http://localhost/cgi-bin/mapserv.exe" target="_blank">http://localhost/cgi-bin/mapserv.exe</a>",<br>
{map: 'C:/Program Files/ms4w/Apache/htdocs/MSrecipes/usa1.map'} );<br>
// {map: 'C:/Program Files/ms4w/Apache/htdocs/usa1.map'} );<br>
<br>
map.addLayer(layer);<br>
map.zoomToMaxExtent();<br>
}<br>
// --><br>
</script><br>
</head><br>
<body onload="init()"><br>
<div id="map"></div><br>
</body><br>
</html><br>
<br>
<br>
============<br>
map file<br>
==============<br>
<br>
MAP<br>
NAME USA1<br>
STATUS ON<br>
SIZE 800 500<br>
IMAGETYPE PNG<br>
IMAGECOLOR 240 240 240<br>
SHAPEPATH "C:\oatdir\statesp020.tar"<br>
EXTENT -8000000 300000 5000000 1500000<br>
UNITS METERS<br>
PROJECTION<br>
"proj=latlong" "lat_1=32" "lat_2=44" "lat_0=38" "lon_0=-100" "x_0=0" "y_0=0" "ellps=GRS80" "datum=NAD83"<br>
END<br>
WEB<br>
IMAGEPATH "C:\Program Files\ms4w\Apache\htdocs\tmp\"<br>
IMAGEURL "/tmp/"<br>
END<br>
<br>
LAYER<br>
NAME "US state boundaries"<br>
TYPE POLYGON<br>
STATUS DEFAULT<br>
DATA 'C:\oatdir\statesp020.tar\statesp020'<br>
<br>
PROJECTION<br>
"proj=latlong"<br>
"ellps=GRS80"<br>
"datum=NAD83"<br>
END<br>
CLASS<br>
NAME "US states"<br>
OUTLINECOLOR 60 60 60<br>
COLOR 255 255 0<br>
SYMBOL 0<br>
END<br>
END<br>
<br>
<br>
<br>
END<br>
<div class="WgoR0d"><br>
<br>
____________________________________________________________________________________<br>
Be a better friend, newshound, and<br>
know-it-all with Yahoo! Mobile. Try it now. <a href="http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ" target="_blank">http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ</a><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></blockquote></div><br>