<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
I am trying to develop a map application with php mapscript and postgis. I can map my postgis data in a standard map file and the php mapscript generates a map file on a shape file. However, when I try to generate a php mapscript map I get a blank screen. There are no error messages but the data doesn't display. My php file is shown below. Does anyone have any suggestions?<br><br>Thanks,<br>Sam<br><br><html><br><head></head><br><body><br><?PHP<br>// ex5_map_points.php<br><br><br>// Load MapScript extension<br>if (!extension_loaded("MapScript"))<br> dl('php_mapscript.'.PHP_SHLIB_SUFFIX);<br><br>// Create a map object. Provide empty string if not<br>// using an existing map file<br>$oMap = ms_newMapObj("");<br><br>// Set size of the output map image<br>$oMap->setSize(256,256);<br><br><br>$oMap->web->set(imagepath,"/ms4w/tmp/ms_tmp/");<br>$oMap->web->set(imageurl,"/ms_tmp/");<br><br>// Set the geographic extents of the map.<br>$oMap->setExtent(1543790,718550,1560340,750790);<br><br><br>// Create a data layer and associate it with the map.<br>// This is the raster layer showing some cloud imagery<br>$oLayerRoads = ms_newLayerObj($oMap);<br>$oLayerRoads->set( "name", "roads");<br>$oLayerRoads->set( "type", MS_LAYER_LINE);<br>$oLayerRoads->set( "status", MS_DEFAULT);<br>$oLayerRoads->set( "connectiontype", "postgis");<br>$oLayerRoads->set( "connection", "dbname=gisdb user=user password=password host=localhost port=5432");<br>$oLayerRoads->set( "data", "the_geom from (select * from roads) as foo using unique gid using SRID=2242");<br><br><br>// Create a class object to set feature drawing styles.<br>$oMapClass = ms_newClassObj($oLayerRoads);<br><br><br>// Create a style object defining how to draw features<br>$oRoadsStyle = ms_newStyleObj($oMapClass);<br>$oRoadsStyle->color->setRGB(255,0,0);<br><br><br><br>// Create label settings for drawing text labels<br>$oMapClass->label->set( "position", MS_AUTO);<br>$oMapClass->label->color->setRGB(250,0,0);<br>$oMapClass->label->outlinecolor->setRGB(255,255,255);<br><br><br><br>// Render the map into an image object<br>$oMapImage = $oMap->draw();<br><br>$image_url=$oMapImage->saveWebImage();<br><br><br>?><br><img src=<?php echo $image_url; ?> alt="Map" /><br></body><br></html><br><br /><hr />Need to know now? Get instant answers with Windows Live Messenger. <a href='http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008' target='_new'>IM on your terms.</a></body>
</html>