<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Hi All,<BR>
<BR>
I am new to ka-maps and facing some problems can any body help me creating maps on fly, may I ignore the maps files and use my own mapscript instead, my mapscript code works fine and also draw maps, how can I handle my own <FONT><FONT>mapscript </FONT>to</FONT> config.<FONT>php</FONT> or to init.<FONT>php</FONT>, ,my code is as follow.<BR>
<BR>
<?php<BR>include_once('admin/super/classes/Connection.php');<BR>
if (!extension_loaded("MapScript"))<BR> dl('php_mapscript_48.'.<FONT><FONT>PHP_SHLIB_SUFFIX</FONT></FONT>);<BR> <BR>
class MapHandler<BR>{<BR>
function getMyMaps($user_id)<BR> {<BR>$con= new Connection();<BR>$con->connect();<BR>$con->selectDatabase("blot");<BR>$myCon=$con->getConnectionReference();<BR>$count=0;<BR>$userMap=array();<BR>$userMaps=array();<BR>
$qry="SELECT * from maps where user_id=".$user_id;<BR>$rs=mysql_query($qry ,$myCon) or die(mysql_error());<BR>
if(mysql_num_rows($rs) > 0 )<BR> {<BR> while($row=mysql_fetch_array($rs))<BR> {<BR> $lot_id=$row['lot_id'];<BR> $lot_name=$row['lot_name'];<BR> $lot_width=$row['image_width'];<BR> $lot_height=$row['image_length'];<BR> $lot_image="admin".$row['image_location'];<BR> $myMap= ms_newMapObj("mapTest.map");<BR>
$myMap->set("name","lot".++$count);<BR> $myMap->set("width",$lot_width);<BR> $myMap->set("height",$lot_height);<BR> $myMap->setExtent(0.0,0.0,$lot_width,$lot_height);<BR> $myMap->selectOutputFormat("png");<BR> $myMap->outputformat->set("transparent", MS_ON );<BR> $myLayer = ms_newLayerObj($myMap);<BR> $myLayer->set( "name", "Lot");<BR> $myLayer->set( "type", MS_LAYER_RASTER);<BR> $myLayer->set( "status", MS_ON);<BR> $myLayer->set( "data",$lot_image);<BR> $myMap->web->set("imagepath","/ms4w/tmp/<FONT>ms_<FONT>tmp</FONT></FONT>/kacache/");<BR> $myMap->web->set("imageurl","/<FONT>ms_<FONT>tmp</FONT></FONT>/kacache/");<BR> $myMap->reference->set("width",($lot_width/4));<BR> $myMap->reference->set("height",($lot_height/4));<BR> $myMap->reference->set("image",$lot_image);<BR> $myMap->reference->set("status",MS_ON); <BR> //$myMap->reference->setextent(0, 0, 100,150);<BR> $rect= ms_newRectObj();<BR> $rect->setextent(0.0, 0.0, ($lot_width/4), ($lot_height/4));<BR> $userMaps['plot'.$count++] = $myMap;<BR>}<BR> $szMap = 'plot0';<BR> //$aszMapFiles=$userMaps;<BR> return $userMaps;<BR> }<BR> }<BR>}<BR>?><BR>
<BR>
can I handover $userMaps to ka-map to deal with these maps only , what i have to do, <BR>
<BR>
Regards<BR>
Ghulam Muqtada<BR><br /><hr />Use Messenger to talk to your IM friends, even those on Yahoo! <a href='http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe' target='_new'>Talk now!</a></body>
</html>