<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>Hi Roger,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>you must declare the right projection for your map. Without 
any option the projection OpenLayers will use is EPSG:4326 with -180,-90,180,90 
as extent. So the response of the WMS request is all right, if you 
get&nbsp;blank tiles. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>Try something like this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp; var options = 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; projection: 
"EPSG:2286",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //perhaps also 
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //maxResolution: 
....</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; units: 
"m",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxZoomLevel&nbsp; : 
16,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if set you must add your 
controls manuel after the map declaration</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//controls&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 
[],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numZoomLevels : 
16,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //this is a 
guess</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxExtent: new 
OpenLayers.Bounds(500000, 500000, 1000000, 1000000)<BR>&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp; map&nbsp; = new OpenLayers.Map('map',&nbsp; 
options);<BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2>With maxResolution I am not all clear. I always set it. For 
Google it is 156543.0339.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2><!-- Converted from text/plain format -->
<P><FONT size=2>Mit freundlichen Grüssen<BR><BR>Arnd Wippermann<BR><A 
href="http://gis.ibbeck.de/ginfo/">http://gis.ibbeck.de/ginfo/</A><BR><BR></FONT></P></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN><SPAN class=281442117-30042008><FONT 
face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Roger 
André<BR><B>Gesendet:</B> Mittwoch, 30. April 2008 03:49<BR><B>An:</B> 
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] Trouble getting 
mapserver WMS layer to load in OL<BR></FONT><BR></DIV>
<DIV></DIV>Hi,<BR><BR>I'm a new user of Mapserver and am having a hard time with 
getting layers from a new mapfile to load in OpenLayers.&nbsp; I've tested that 
my local mapserver install is responding correctly to WMS requests, and it seems 
to work correctly.&nbsp; Here is the request, with some linebreaks for 
clarity;<BR><BR><A 
href="http://localhost/cgi-bin/mapserv?map=/var/www/520_webmap/mapfiles/520_ECP.map">http://localhost/cgi-bin/mapserv?map=/var/www/520_webmap/mapfiles/520_ECP.map</A><BR>&amp;SERVICE=WMS<BR>&amp;version=%221.1.122<BR>&amp;REQUEST=GetMap<BR>&amp;LAYERS=Wetlands<BR>&amp;STYLES=<BR>&amp;BBOX=775843.302946,602429.871045,848438.746010,635418.446144<BR>&amp;WIDTH=600<BR>&amp;HEIGHT=400<BR>&amp;FORMAT=png<BR>&amp;SRS=epsg:2286<BR><BR>This 
returns an image that contains all of the layers which are active at the scale 
of the BBOX area.&nbsp; However, I cannot seem to find the right syntax to get 
the layer to load into OpenLayers.&nbsp; I have taken one of the test.html 
files, the one for a single wms, and have tested that it works with my 
openlayers.js install.&nbsp; This is that 
file:<BR>-----------------------<BR>&lt;html xmlns="<A 
href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"&gt;<BR>&nbsp; 
&lt;head&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;title&gt;OpenLayers Basic Single WMS 
Example&lt;/title&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;link rel="stylesheet" 
href="../theme/default/style.css" type="text/css" /&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;style type="text/css"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #map 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 
512px;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
height: 
512px;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
border: 1px solid black;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; &lt;/style&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;script src="<A 
href="http://localhost:8080/geoserver/www/openlayers/OpenLayers.js">http://localhost:8080/geoserver/www/openlayers/OpenLayers.js</A>"&gt;&lt;/script&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;script 
type="text/javascript"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var 
map, layer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function 
init(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map = new OpenLayers.Map( 'map' 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer = 
new OpenLayers.Layer.WMS( "OpenLayers 
WMS",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"<A 
href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</A>",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{layers: 'basic'} 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.addLayer(layer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.zoomToMaxExtent();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp; &lt;/script&gt;<BR>&nbsp; &lt;/head&gt;<BR>&nbsp; 
&lt;body onload="init()"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;h1 id="title"&gt;Basic 
Single WMS Example&lt;/h1&gt;<BR><BR>&nbsp;&nbsp;&nbsp; &lt;div 
id="tags"&gt;&lt;/div&gt;<BR><BR>&nbsp;&nbsp;&nbsp; &lt;div 
id="shortdesc"&gt;Show a Simple Map&lt;/div&gt;<BR><BR>&nbsp;&nbsp;&nbsp; 
&lt;div id="map"&gt;&lt;/div&gt;<BR><BR>&nbsp;&nbsp;&nbsp; &lt;div 
id="docs"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This example shows a 
very simple layout with minimal controls.&nbsp; This example uses a single WMS 
base layer.<BR>&nbsp;&nbsp;&nbsp; &lt;/div&gt;<BR>&nbsp; 
&lt;/body&gt;<BR>&lt;/html&gt;<BR>------------------------------<BR><BR>No 
matter how I edit the file though, when I point to my localhost mapserver 
instance, I just get an empty map frame, with no map controls, or anything 
inside of it.&nbsp; Right now the layer portion looks like 
this:<BR><BR>&nbsp;&nbsp;&nbsp; &lt;script 
type="text/javascript"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var 
map, layer;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function 
init(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map = new OpenLayers.Map('map', <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
{&nbsp;&nbsp;&nbsp; maxExtent: new 
OpenLayers.Bounds(775843.302946,602429.871045,848438.746010,635418.446144), 
<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; maxResolution: 
"auto",<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
projection:"SRS_not_defined" <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } 
);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer = new 
OpenLayers.Layer.WMS(&nbsp;&nbsp;&nbsp; '520_WebMap', <BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; "<A 
href="http://localhost/cgi-bin/mapserv">http://localhost/cgi-bin/mapserv</A>?",<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; layers: 'Wetlands', 
<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map: 
'map=/var/www/520_webmap/mapfiles/520_ECP.map',<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; format: 'image/png',<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; request: 'getmap',<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; transparent: "false"<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; });<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
map.addLayer(layer);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
map.zoomToMaxExtent();<BR>&nbsp;&nbsp;&nbsp; &lt;/script&gt;<BR><BR>I'm hoping 
one of you has encountered a similar problem and can give me some advice for how 
to resolve it.<BR><BR>Thanks,<BR><BR>Roger<BR></BODY></HTML>