<!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> </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 blank tiles. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </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> </DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial
color=#0000ff size=2> var options =
{<BR> projection:
"EPSG:2286",<BR> //perhaps also
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial
color=#0000ff size=2> //maxResolution:
....</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial
color=#0000ff size=2> units:
"m",<BR> maxZoomLevel :
16,<BR> //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>
//controls :
[],<BR> numZoomLevels :
16,<BR> //this is a
guess</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=281442117-30042008><FONT face=Arial
color=#0000ff size=2> maxExtent: new
OpenLayers.Bounds(500000, 500000, 1000000, 1000000)<BR>
};<BR> map = new OpenLayers.Map('map',
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> </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> </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. I've tested that
my local mapserver install is responding correctly to WMS requests, and it seems
to work correctly. 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>&SERVICE=WMS<BR>&version=%221.1.122<BR>&REQUEST=GetMap<BR>&LAYERS=Wetlands<BR>&STYLES=<BR>&BBOX=775843.302946,602429.871045,848438.746010,635418.446144<BR>&WIDTH=600<BR>&HEIGHT=400<BR>&FORMAT=png<BR>&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. However, I cannot seem to find the right syntax to get
the layer to load into OpenLayers. 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. This is that
file:<BR>-----------------------<BR><html xmlns="<A
href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><BR>
<head><BR> <title>OpenLayers Basic Single WMS
Example</title><BR> <link rel="stylesheet"
href="../theme/default/style.css" type="text/css" /><BR>
<style type="text/css"><BR> #map
{<BR> width:
512px;<BR>
height:
512px;<BR>
border: 1px solid black;<BR>
}<BR> </style><BR> <script src="<A
href="http://localhost:8080/geoserver/www/openlayers/OpenLayers.js">http://localhost:8080/geoserver/www/openlayers/OpenLayers.js</A>"></script><BR>
<script
type="text/javascript"><BR> var
map, layer;<BR> function
init(){<BR>
map = new OpenLayers.Map( 'map'
);<BR> layer =
new OpenLayers.Layer.WMS( "OpenLayers
WMS",<BR>
"<A
href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</A>",<BR>
{layers: 'basic'}
);<BR>
map.addLayer(layer);<BR>
map.zoomToMaxExtent();<BR>
}<BR> </script><BR> </head><BR>
<body onload="init()"><BR> <h1 id="title">Basic
Single WMS Example</h1><BR><BR> <div
id="tags"></div><BR><BR> <div
id="shortdesc">Show a Simple Map</div><BR><BR>
<div id="map"></div><BR><BR> <div
id="docs"><BR> This example shows a
very simple layout with minimal controls. This example uses a single WMS
base layer.<BR> </div><BR>
</body><BR></html><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. Right now the layer portion looks like
this:<BR><BR> <script
type="text/javascript"><BR> var
map, layer;<BR> function
init(){<BR>
map = new OpenLayers.Map('map', <BR>
{ maxExtent: new
OpenLayers.Bounds(775843.302946,602429.871045,848438.746010,635418.446144),
<BR>
maxResolution:
"auto",<BR>
projection:"SRS_not_defined" <BR>
}
);<BR>
layer = new
OpenLayers.Layer.WMS( '520_WebMap', <BR>
"<A
href="http://localhost/cgi-bin/mapserv">http://localhost/cgi-bin/mapserv</A>?",<BR>
{ layers: 'Wetlands',
<BR>
map:
'map=/var/www/520_webmap/mapfiles/520_ECP.map',<BR>
format: 'image/png',<BR>
request: 'getmap',<BR>
transparent: "false"<BR>
});<BR>
map.addLayer(layer);<BR>
map.zoomToMaxExtent();<BR> </script><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>