[mapserver-users] Setting a map extent for point data (phpmapscript)

Bart van Heijningen bart at atsence.nl
Mon Jun 10 18:50:06 EDT 2002


Hi List,
I have a zip code point dataset on which I would like to perform a text
search via a form.
The search works out fine but I just cannot seem to be able to give the
projected map a good map_extent (see snippett).
Believe me I tried quite some options but you can probably tell me the
one I missed out on.
 
I tried to do the following to have say 1000 x 1000 meter extend around
the location of the zip point.
 
<?
 
$distance = 1000;                 // <--change this 
$minx = ( [XCOORD] ) - $ distance;
$miny = ( [YCOORD] ) - $ distance;
$maxx = ( [XCOORD] ) + $ distance;
$maxy = ( [YCOORD] ) + $ distance;
$map->SetExtent( $minx, $miny, $maxx, $maxy );
 
?>
 
sure  the php is not touched when passed through the cgi.. But now I
wonder how I could perform calculations like these..
 
Another option I tried:
 
 
<img
src="/cgi-bin/mapserv?map=[map]&item=zip&value=[value2]&mode=itemqueryma
p&mapext=shapes&map_extent=shapes" height="300" width="300"></td>
 
or
 
<td><img
src="/cgi-bin/atms?map=[map]&item=Pc6nr&value=[value]&mode=itemquerymap&
mapext=[mapext]" height="300" width="300"></td>
 
The bottom line I did not succeed in dynamically adjusting the
mapextent. Sorry..
Help would be really appreciated.
 
Thanx,
Bart
 
(I am still working with the (old) MS 3.5 and RH7.0 php3.x, as I got
really frustrated in trying to make 3.6 and php4.x & RH7.3 to be friends
and never got an answer how to get it to work. The only comfort being
that I am apparently not the only one out there.)
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020611/ddc95e60/attachment.html


More information about the mapserver-users mailing list