$map->extent->set method behavior

Doyon, Jean-Francois Jean-Francois.Doyon at CCRS.NRCan.gc.ca
Mon Aug 21 08:53:24 PDT 2000


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.

I determine new extents through some calculations, and then try to set them,
but I keep
loosing all the decimal places !

For instance, if I calculate MINX to be $newminx = 12345.67890 and then do :

$map->extent->set(minx,$newminx);

And then echo the result, I just get 12345 ! This is a problem for me when I
zoom in ...

I tried putting double quotes around "minx" the "string" property_name (as
per docs), but
no luck. I even tried putting them in around $newminx, but that of course
didn't help.

The values are described as "doubles" in the docs as well, so why am I
loosing accuracy ?

Thanks for the help !

J.F.

> ----------
> From: 	Daniel Morissette[SMTP:danmo at videotron.ca]
> Sent: 	Friday, August 18, 2000 12:31 PM
> To: 	Doyon, Jean-Francois
> Cc: 	mapserver-users at lists.gis.umn.edu
> Subject: 	Re: TrueType font support with PHP 3.0.15 on RH 6.2 ?
> 
> "Doyon, Jean-Francois" wrote:
> > 
> > I'm trying to get the extent of a map (as set in the map file) into
> > variables
> > for manipulation, but am not having any luck.
> > 
> > I've tried things like :
> > 
> > $minx = $map->extent->minx;
> > $minx = $map->extent(minx);
> > $extent = $map->extent;
> > echo $extent->minx
> > 
> > and a few more ... but I never get anything returned ! (No errors
> though).
> > 
> 
> Assuming your Map Object is called "$map", then
> 
> 	echo $map->extent->minx;
> or
> 	$minx = $map->extent->minx;
> 
> should both work... we use it a lot. So it must be something else that
> you overlooked in your function.
> 
> BTW, $extent = $map->extent;
>      echo $extent->minx;
> should work too.
> 
> -- 
> ------------------------------------------------------------
>  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