[maplab-users] PhpMapScript- setExtent problem - URGENT

Daniel Morissette dmorissette at dmsolutions.ca
Thu Jun 24 10:04:06 EDT 2004


Swapan Mazumdar wrote:
> Paul,
> 
> Thank you for your prompt reply. I used the same calculations suggested
> by you but now the map doesn't show even. Pl. look at the output of
> $rec->extent attributes below.
> 
> $rect = $shpObject->bounds;
> $dx = abs(($rect->maxx - $rect->minx) * 0.1); $dy = abs(($rect->maxy -
> $rect->miny) * 0.1); echo "BEFORE: $rect->minx, $rect->miny,
> $rect->maxx, $rect->maxy"; // BEFORE: -47898.6578075, -3394254.84527,
> -47397.1956946, -3393854.31115
> $rect->setExtent( $minx - $dx, $miny - $dy, $maxx + $dx, $maxy + $dy );	
> echo "AFTER: $rect->minx, $rect->miny, $rect->maxx, $rect->maxy";
> AFTER: -50.1462112868, -40.0534118076, 50.1462112868, 40.0534118076
> $oMap->setExtent($rect->minx, $rect->miny, $rect->maxx, $rect->maxy);
> 

If you look closely at the setExtent call you'll notice that it uses 
$minx, $maxx,...  variable names that are not set in your script. Try:

$oMap->setExtent( $rect->minx - $dx, $rect->miny - $dy, $rect->maxx + 
$dx, $rect->maxy + $dy );


-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the Maplab-users mailing list