[ms4w-users] routing aplication not appear on Gmap
Jeff McKenna
jmckenna at dmsolutions.ca
Fri Aug 31 17:24:36 EDT 2007
You'll have more chance of getting phpmapscript help on the main
MapServer mailing list, sorry. (list info at
http://mapserver.gis.umn.edu/community/mailinglists/mapserver-users/)
--
jeff
ari sutanto wrote:
> Hi list, I have any problems about Gmap.
> i have a routing aplication, 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..
>
> Regards,
>
> Ari Sutanto
More information about the ms4w-users
mailing list