problem with PHP/MapScript
ari sutanto
arisutanto_jogja at YAHOO.CO.ID
Tue Sep 4 18:08:32 PDT 2007
Hi list,
I have any problems about GMap75 PHP/MapScript.
i have an aplication of php, like this,
<?php
dl("php_mapscript.dll");
define("MAPFILE","../maps/routing.map");
$start=0;
$end=0;
$cx1=0;
$cy1=0;
$cx2=0;
$cy2=0;
if($HTTP_GET_VARS["start"])
$start=$HTTP_GET_VARS["start"];
if($HTTP_GET_VARS["end"])
$end=$HTTP_GET_VARS["end"];
if($HTTP_GET_VARS["cx1"])
$cx1=$HTTP_GET_VARS["cx1"];
if($HTTP_GET_VARS["cx2"])
$cx2=$HTTP_GET_VARS["cx2"];
if($HTTP_GET_VARS["cy1"])
$cy1=$HTTP_GET_VARS["cy1"];
if($HTTP_GET_VARS["cy2"])
$cy2=$HTTP_GET_VARS["cy2"];
$delta=0.01;
$map_file=MAPFILE;
$map=ms_newMapObj($map_file);
$l=$map->getLayerByName("network");
if($l) {
if($l && $start!=0 && $end!=0) {
if($cx1!=0 && $cy1!=0 && $cx2!=0 && $cy2!=0 &&
$cx1!=$cx2 && $cy1!=$cy2) {
$minx = min($cx1,$cx2)-$delta;
$miny = min($cy1,$cy2)-$delta;
$maxx = max($cx1,$cx2)+$delta;
$maxy = max($cy1,$cy2)+$delta;
$map->setextent($minx,$miny,$maxx,$maxy);
$rectobj = $map->extent;
$ll_x = $rectobj->minx;
$ll_y = $rectobj->miny;
$ur_x = $rectobj->maxx;
$ur_y = $rectobj->maxy;
$sql="the_geom from (select gid, the_geom from
"."shortest_path_astar2_as_geometry_internal_id_directed('tercepat',
".$start.", ".$end.", ".$ll_x.", ".$ll_y.", ".$ur_x.",
".$ur_y.", false, true)) as g using unique gid using
SRID=-1";
$l->set('data', $sql);
$l->set('status', MS_ON);
}
}
else {
$l->set('status', MS_OFF);
}
}
$image=$map->draw();
$image_url=$image->saveWebImage();
?>
i put into Gmap template in gmap75.phtml, why the
result of this doesn't come up in map display? but
actually the case appear in tmp folder.
Thanks,
Regards,
Ari Sutanto
________________________________________________________
Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/
More information about the MapServer-users
mailing list