<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009>add maxResolution and maxExtent <FONT face=Arial
color=#0000ff size=2><SPAN class=140293617-02052009>to your map declaration,
then it should work.</SPAN></FONT></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009><FONT face="Times New Roman" color=#000000 size=3>map =
new OpenLayers.Map('map', {</FONT><BR>...</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT
size=2>maxResolution: Math.abs(117107.3758-940177.4915)/256,<BR>maxExtent: new
OpenLayers.Bounds(117107.3758, 11491.8435, 940177.4915, 326719.7326)<SPAN
class=140293617-02052009>,</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009>...</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=140293617-02052009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2>the <SPAN
class=140293617-02052009>b</SPAN>ounds come from : </FONT><A
href="http://spatialreference.org/ref/epsg/32119/"><FONT face=Arial
size=2>http://spatialreference.org/ref/epsg/32119/</FONT></A></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>* WGS84
Bounds: -84.3200, 33.8000, -75.4300, 36.5800<BR>* Projected Bounds: 117107.3758,
11491.8435, 940177.4915, 326719.7326<BR>* Scope: Large and medium scale
topographic mapping and engineering survey.<BR>* Last Revised: 2007-01-19<BR>*
Area: USA - North Carolina<BR></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=140293617-02052009><FONT face=Arial
color=#0000ff size=2>By the way. In the mapfile you should use extent in
the same projection as your map projection, also it doesn't effect the
output.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=140293617-02052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=140293617-02052009><FONT face=Arial
color=#0000ff size=2>Arnd</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=140293617-02052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=140293617-02052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT face=Tahoma size=2><B>Von:</B>
users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <B>Im Auftrag
von </B>cole gillespie<BR><B>Gesendet:</B> Samstag, 2. Mai 2009
01:59<BR><B>An:</B> users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users]
Problem with Mapserver + PostGIS + Openlayers<BR></FONT><BR></DIV>
<DIV></DIV>Users,<BR><BR>I am having trouble with my Openlayers map. I have a
mapfile that I am trying to view inside of Openlayers. I feel like I am doing
every thing right but all I am getting to show up inside of Openlayers is a
white image. Below I will include both my map file and my openlayers html file.
Any suggestions on what I am doing wrong would be greatly
appreciated.<BR><BR>///////////////////////////////Mapfile///////////////////////////////////////////<BR><BR>MAP<BR>
EXTENT -84.321869 33.752878 -75.400119 36.588157<BR> FONTSET
"fonts/fonts.list"<BR> IMAGECOLOR 255 255 255<BR> IMAGETYPE
png<BR> SHAPEPATH "/ms4w/apps/tutorial/data"<BR> SIZE 800
600<BR> STATUS ON<BR> UNITS METERS<BR> NAME "MS"<BR><BR>
OUTPUTFORMAT<BR> NAME "png"<BR> MIMETYPE
"image/png"<BR> DRIVER "GD/PNG"<BR>
EXTENSION "png"<BR> IMAGEMODE "PC256"<BR>
TRANSPARENT FALSE<BR> END<BR><BR> OUTPUTFORMAT<BR>
NAME "AGG"<BR> MIMETYPE "image/png;
mode=24bit"<BR> DRIVER "AGG/PNG"<BR>
EXTENSION "png"<BR> IMAGEMODE "RGB"<BR>
TRANSPARENT FALSE<BR> END<BR><BR> PROJECTION<BR>
"init=epsg:32119"<BR> END<BR> LEGEND<BR>
IMAGECOLOR 255 255 255<BR> KEYSIZE 20 10<BR>
KEYSPACING 5 5<BR> LABEL<BR>
SIZE MEDIUM<BR> TYPE
BITMAP<BR> BUFFER
0<BR> COLOR 0 0
0<BR> FORCE
FALSE<BR> MINDISTANCE
-1<BR> MINFEATURESIZE
-1<BR> OFFSET 0
0<BR> PARTIALS TRUE<BR>
END<BR> POSITION LL<BR> STATUS OFF<BR>
END<BR><BR> QUERYMAP<BR> COLOR 255 255
0<BR> SIZE -1 -1<BR> STATUS
OFF<BR> STYLE HILITE<BR> END<BR><BR>
SCALEBAR<BR> ALIGN CENTER<BR> COLOR 0 0
0<BR> IMAGECOLOR 255 255 255<BR> INTERVALS
4<BR> LABEL<BR> SIZE
MEDIUM<BR> TYPE
BITMAP<BR> BUFFER
0<BR> COLOR 0 0
0<BR> FORCE
FALSE<BR> MINDISTANCE
-1<BR> MINFEATURESIZE
-1<BR> OFFSET 0
0<BR> PARTIALS TRUE<BR>
END<BR> POSITION LL<BR> SIZE 200
3<BR> STATUS OFF<BR> STYLE
0<BR> UNITS MILES<BR> END<BR><BR>
WEB<BR> IMAGEPATH
"/ms4w/apache/htdocs/tmp/ms_tmp"<BR> IMAGEURL
"tmp/ms_tmp"<BR> QUERYFORMAT text/html<BR>
LEGENDFORMAT text/html<BR> BROWSEFORMAT text/html<BR>
END<BR><BR><BR><BR> LAYER<BR> CONNECTION "user=postgres
dbname=postgis password=help37546"<BR> CONNECTIONTYPE
POSTGIS<BR> DATA "the_geom FROM (<BR> SELECT
<BR> Zipcodes.the_geom AS the_geom, <BR>
Zipcodes.gid as gid, <BR> Zip.income as
income<BR> FROM zipcodes JOIN zip <BR> ON
zipcodes.zcta = zip.zcta) AS new_table USING UNIQUE gid USING
SRID=-1"<BR> FILTER "income > 0 and income <=
200000"<BR> NAME "themelayer"<BR>
PROJECTION<BR>
"init=epsg:32119"<BR> END<BR> STATUS
ON<BR> TYPE POLYGON<BR> UNITS
METERS<BR> CLASS<BR>
STYLE<BR> ANGLE
360<BR> COLOR 255 228
181<BR> OPACITY
100<BR> SYMBOL
0<BR> END<BR> END<BR>
END<BR>END<BR><BR><BR>/////////////////////////////////////openlayers
file///////////////////////////////////////////////////////<BR><BR><BR><html
xmlns="<A
href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><BR>
<head><BR> <title>MapServer
Layer</title><BR> <link rel="stylesheet"
href="../theme/default/style.css" type="text/css" /><BR>
<link rel="stylesheet" href="style.css" type="text/css"
/><BR> <script src="<A
href="http://openlayers.org/dev/lib/OpenLayers.js">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> projection: "epsg:32119",<BR>
<BR> numZoomLevels: 14,<BR> <BR>
units : "meters",<BR> controls: [<BR>
new<BR>OpenLayers.Control.ZoomToMaxExtent(),<BR>
new<BR>OpenLayers.Control.PanZoomBar({zoomWorldIcon:
true}),<BR>
new<BR>OpenLayers.Control.LayerSwitcher({'ascending':false}),<BR>
new<BR>OpenLayers.Control.MousePosition(),<BR>
new<BR>OpenLayers.Control.MouseDefaults(),<BR>
new<BR>OpenLayers.Control.KeyboardDefaults()<BR>
]
<BR> }); <BR>
layer = new OpenLayers.Layer.MapServer( "County
Map",<BR> "<A
href="http://localhost/cgi-bin/mapserv.exe">http://localhost/cgi-bin/mapserv.exe</A>",
{map: "C:/ms4w/Apache/htdocs/test_mapfile_edit.map", layers: "themelayer"}
);<BR> <BR>
map.addLayer(layer);<BR> <BR>
map.zoomToMaxExtent();<BR>
}<BR> <BR>
</script><BR> </head><BR> <body
onLoad="init()"><BR> <div id="title">MapServer
Layer</div><BR> <div
id="tags"></div><BR> <div id="shortdesc">Shows
MapServer Layer</div><BR> <div id="map"
class="smallmap"></div><BR> <div
id="docs"><BR>
<BR> </div><BR>
</body><BR></html><BR></BODY></HTML>