Menu ▾ ▴

#8 zoomtoextent

open
5
2005-05-25
2005-05-25
Anonymous
No

A simple function that calls zoomToExtent does not
work for some reason. Its works the first time, but
second time onwards it fails. It seems that after calling
this function the extents are not saved in $IMSmap .
Please contact me for more verbose description
vpahujaNOSPAN@gmail.com. Get rid of the obvious
from the email.

function zoominToEnvelope() {
global $IMSmap;
//echo "i am in zoominToEnvelope ";
$mapX1=$_GET['mapimgx'];
$mapY1=$_GET['mapimgy'];
$mapX2=$_GET['mapimgx2'];
$mapY2=$_GET['mapimgy2'];
echo
$mapX1. " " .$mapY1. " " .$mapX2. " " .$mapY2;
//$cx=abs($mapX2-$mapX1);
//$cy=abs($mapY2-$mapY1);
//echo " " .$cx. " " .$cy;
//$center=$IMSmap->getMapPoint($cx,$cy);
$arr2=$IMSmap->getMapPoint
($mapX2,$mapY2);
$arr1=$IMSmap->getMapPoint
($mapX1,$mapY1);
//$testEnv = $IMSmap->getExtent();
//echo " testenv" .$testEnv->maxX;

$x1=$arr1[0];
$y1=$arr1[1];
$x2=$arr2[0];
$y2=$arr2[1];
//$center=array();
//$center[0]=$x2-$x1;
//$center[1]=$y2-$y1;
$IMSmap->zoomIn(3);
$IMSmap->pan($center);
//echoEnvelope($x2,$y2,$x1,$y1);
//echoEnvelope($mx1,$my1,$mx2,$my2);
$newExtent = new aimsEnvelope
($x2,$y2,$x1,$y1);
$IMSmap->zoomToExtent($newExtent);
//$IMSmap->setExtent($newExtent);
// $IMSmap->zoomInByEnvelope($x2,$y2,$x1,$y1);

}

Discussion


Log in to post a comment.