PHP Mapscript: Map extent not being set to what I am passing setExtent on my map object

Matt Pettis matt.pettis at THOMSON.COM
Mon Nov 26 13:31:48 PST 2007


umm... i think i *may* have answered my own question... does it have to
do with the dimensions of the ouput image that is set?  i have a final
image that has a 4:3 ratio, and does the setExtent function
automatically account for the image dimensions?  It seems so, for when I
do this:
 
=== PHP code ===
 
$map->setExtent(-1,-1,1,1);
echo "<pre>final extent is: "; print_r( $map->extent ); echo
"</pre><br>\n";

=== End PHP code ===
 
 
I get:
 
=== HTML Output ===
 
final extent is: ms_rect_obj Object
(
    [_handle_] => Resource id #7
    [minx] => -1.33333333333
    [miny] => -1
    [maxx] => 1.33333333333
    [maxy] => 1
)
 
=== End HTML Output ===
 
Just threw me...
 
thanks,
matt
 

________________________________

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Pettis, Matthew (TOC TGTI)
Sent: Monday, November 26, 2007 3:24 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] PHP Mapscript: Map extent not being set
to what I am passing setExtent on my map object


Hi,
 
I am passing an extent to my map object to set it, but it is not being
set to what I am telling it.  I cannot find an error -- can someone look
at it?  Here's the relevant code:
 
=== PHP code ===
 
echo "<pre>buf_max_extent is: "; print_r( $buf_max_extent ); echo
"</pre><br>\n";
$map->setExtent($buf_max_extent[1],$buf_max_extent[2],$buf_max_extent[3]
,$buf_max_extent[4]);
echo "<pre>final extent is: "; print_r( $map->extent ); echo
"</pre><br>\n";

=== End PHP code ===
 
 
 
 
 
 
=== HTTP Output ===
buf_max_extent is: Array
(
    [1] => 490059.61375
    [2] => 5163285.525
    [3] => 764351.51125
    [4] => 5388702.975
)


final extent is: ms_rect_obj Object
(
    [_handle_] => Resource id #7
    [minx] => 476927.2625
    [miny] => 5163285.525
    [maxx] => 777483.8625
    [maxy] => 5388702.975
)
=== End HTTP Output ===
tia,
matt
 
 
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20071126/84f2609a/attachment.htm>


More information about the MapServer-users mailing list