$map->extent->set method behavior
Daniel Morissette
danmo at videotron.ca
Mon Aug 21 22:44:30 PDT 2000
"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