$map->extent->set method behavior

Doyon, Jean-Francois Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Tue Aug 22 18:19:22 EDT 2000


Dan,

Yup, I got his e-mail. He sent me the necessary corrections ot the code. I
recompiled, and voila !

Now I'm having problems with the zoomrectangle function, I'm getting a sig11
on that too !

So far I've tried :

$pixbox = ms_newPointObj($minpt[0],$minpt[1],$axpt[0],$maxpt[1]);
$extent =
ms_newPointObj($HTTP_POST_VARS["minx"],$HTTP_POST_VARS["miny"],$HTTP_POST_VA
RS["maxx"],$HTTP_POST_VARS["maxy"]);
$map->zoomrectangle($pixbox,$map->width,$map->height,$extent);

And also putting all the variables straight into the zoomrectangle :

$map->zoomrectangle($minpt[0],$minpt[1], ....

I'm gonna try using the zoompoint to pan see if the same thing happens ...

Also, the pixel coordinates, should they be passed with 0,0 top left (As the
ROSA applet does it :) or bottom left ?

Thanks,
J.F.

> ----------
> From: 	Daniel Morissette[SMTP:danmo at videotron.ca]
> Sent: 	Tuesday, August 22, 2000 1:44 AM
> To: 	Doyon, Jean-Francois
> Cc: 	mapserver-users at lists.gis.umn.edu
> Subject: 	Re: $map->extent->set method behavior
> 
> "Doyon, Jean-Francois" wrote:
> > 
> > Hello everyone ...
> > 
> > I'm trying to set new extents for a map using PHP/Mapscript, and noticed
> > that
> > the set() method called on the extent of a map object seems to loose the
> > decimal places.
> > 
> 
> Jean-Francois,
> 
> As Assefa pointed in an Email to you earlier, there was a bug in the PHP
> wrapper: the argument was treated as an integer and that explains the
> loss of decimal places that you experienced.
> 
> Until the fixed version is available, you can use:
> 
>    $map->extent->setextent($minx, $miny, $maxx, $maxy);
> 
> the setextent() method does not have the problem that set() has.
> 
> The map class also has a setextent() method.  The difference is that
> $map->setextent() will correct the extents (width/height ratio) before
> setting the minx,miny,maxx,maxy values ... it's a correction that
> MapServer does automatically anyways before redrawing the map.  So
> immediately after the call to $map->setextent() you can look at the
> extent values ($map->extent->minx, etc.) to find out exactly what
> extents the lower-level MapServer will use when it will redraw the map.
> 
> -- 
> ------------------------------------------------------------
>  Daniel Morissette                       danmo at videotron.ca
>               http://pages.infinit.net/danmo/
> ------------------------------------------------------------
>   Don't put for tomorrow what you can do today, because if 
>       you enjoy it today you can do it again tomorrow.
> 



More information about the mapserver-users mailing list