[OpenLayers-Users] Blank Postgis Mapserver layer

Suresh vedsur at yahoo.com
Sat Aug 8 23:49:06 EDT 2009


Hi!

I am trying a simple example to draw a postgis layer using Mapserver
5.4(MS4W) and Openlayers 2.7. I am not getting the usual pink screen. When I
right click and select 'View Image', there is no mapserver error. Hence, I
am assuming that the image is drawn. However, there is no object in the
image.

I am reproducing mapfile and the HTML file below.

Mapfile
-------
NAME				"mumbai"
UNITS				DD
EXTENT			72.777 18.901034910 73.046 19.308258	
SIZE				640 480										
IMAGECOLOR		189 202 222									
IMAGETYPE		PNG											
# Web Object
WEB
	TEMPLATE		"/ms4w/apache/htdocs/vedsur/postgis.php"
	IMAGEPATH	"/ms4w/tmp/ms_tmp/"
	IMAGEURL		"/ms_tmp/"
END
# PostGIS layer
LAYER
	CONNECTIONTYPE	postgis
	NAME				"Roads"
	CONNECTION		"user=suresh password=suresh dbname=ios host=localhost"
	DATA				"stretch_geom from stretch" 
	STATUS			ON
	TYPE				LINE
	CLASS
		color 		255 0 255
	END
END # Layer
END # Mapfile

HTML Template
--------------
	   var lon = 72.90;
   	var lat = 19.11;
	   var zoom = 10;
   	var map, layer;
	   function init(){
	   	map = new OpenLayers.Map( 'map' );
	   	var Layer = new OpenLayers.Layer.MapServer( "Circle",
"http://localhost/cgi-bin/mapserv.exe", {map:
'/ms4w/apache/htdocs/vedsur/MumbaiPG.map'}, {gutter: 15});
	   	map.addLayer(Layer);
	   	map.setCenter( new OpenLayers.LonLat(lon, lat), zoom);
	   	map.addControl( new OpenLayers.Control.LayerSwitcher() );
	   	map.addControl( new OpenLayers.Control.MousePosition() );

body onload="init()"
	div id="map" class="smallmap"
	/div
------------------------------------------------------------

I have tried googling (and this forum) for two days before putting this
post. Any help is welcome.

Thanks 
Suresh
-- 
View this message in context: http://n2.nabble.com/Blank-Postgis-Mapserver-layer-tp3411407p3411407.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090808/04181c7f/attachment.html


More information about the Users mailing list