[mapserver-users] returning mouse click coordinates with PHP

Stephen Woodbridge woodbri at swoodbridge.com
Fri Mar 29 17:25:59 EST 2002


Scott,

You don't have a <FORM ACTION="$PHP_SELF" METHOD=GET> ... </FORM>
around your <INPUT ...>

-Steve

Scott D Cogan wrote:
> 
> OK, so i have my map being displayed with PHP and Mapscript calls now.  the
> initial map is displayed fine, however I can't figure out how to make it
> "clickable" so that I can find out which coordiniates have been clicked on.
> any ideas?  also pretty soon i am going to want to do more, like panning,
> zooming, etc, with PHP.  are there any good demo PHP scripts available to
> learn from?  here is my testing.php file:
> thanks!
> -scott
> 
> <?php
> 
> $map_path="C:\\Program Files\\Apache\\htdocs\\mich\\";
> $map = ms_newMapObj($map_path."demo.map");
> $image=$map->draw();
> $image_url=$image->saveWebImage(MS_GIF,1,1,0);
> 
> ?>
> <HTML><HEAD><TITLE>Map 1</TITLE></HEAD>
> <BODY>
>   <center>
>   <?php echo "X=$click_x and Y=$click_y<BR>" ?>
>   <TABLE border=1>
>   <TR><td>
>     <a href="<?php echo $PHP_SELF ?>">
>     <INPUT TYPE=IMAGE NAME=click BORDER=0 SRC=<?php echo $image_url?>
> WIDTH=600 HEIGHT=600 >
>     </a>
>   </td></TR>
>   </TABLE>
>   <center>
> </BODY>
> </HMTL>



More information about the mapserver-users mailing list