[Cartoweb-users] recenter box and scale

Oliver Christen oliver.christen at camptocamp.com
Wed Mar 26 07:50:28 EDT 2008


maybe use the current bbox values to modify your calculations ?
$location = $this->cartoclient->getPluginManager()->getPlugin('location');
$bbox = $location->getLocation();
$bbox should be an object with the properties: $minx, $miny, $maxx, $maxy


>
> Hi All,
> I'd like to improve a feature of a plugin of mine. I need to center the 
> map
> in a point whose coordinates are red from a database and set the scale to 
> a
> fixed value.
> Now the plugIn reads the coordinates (x1,y1) then given two quantities for
> the sides, let me say, Dx and Dy, where Dx and Dy are the sides of the box 
> I
> want, the plugIn calculates:
> xp1=x1-Dx/2 yp1=y1-Dy/2 and xp2=x1+Dx/2 yp2=y1+Dx/2 , the last operation 
> is
> a recenter in (xp1,yp1,xp2,yp2). I've set Dx and Dy in a rough way., If 
> the
> map size changes, the way I implemented, could give some blank space on a
> side.
> Is there a way my plgIn sets x1 and y1 as center point then zooms at a 
> fixed
> scale ?
> thanks and best regards
>
> Giu
> --
> Email.it, the professional e-mail, gratis per te: http://www.email.it/f
>
> Sponsor:
> Scopri le tue passioni con Leonardo.it!
>
> Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7613&d=20080325
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 



More information about the Cartoweb-users mailing list