$map->extent->set method behavior

Daniel Morissette danmo at videotron.ca
Tue Aug 22 16:31:55 PDT 2000


"Doyon, Jean-Francois" wrote:
> 
> 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);
> 

I'm not sure why you get a seg. fault (we'll have to look into that),
but I suspect that the problem must be that you create $pixbox and
$extent as pointObj instead of $rectObj:

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

Also, the pointObj and rectObj constructors do not accept arguments to
initialize the new object (like you tried to do), but that could be
useful sometimes... I'll add that to the ToDo list.

I just checked the PHP3 README documenting the classes and realized
that the rectObj class is not properly documented in there. It's
incomplete and contains a copy/paste error... I'll fix that.

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

Pixel coordinates passed to $map->zoomrectangle() or $map->zoompoint()
are with (0,0) at the top-left.  I'll add a note about that in the docs.

Regards,
-- 
------------------------------------------------------------
 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