[Cartoweb-users] Zooming in after recenter

Oliver Christen oliver.christen at camptocamp.com
Mon Feb 4 04:50:11 EST 2008


Hi

you need to create a simple filtering plugin that implements FilterProvider.
then simply detect if you are doing a recentering (usualy by checking if the recentering variables names exist in $_REQUEST) and if so, do a recenter_scale:

class ClientRecenter extends ClientPlugin implements FilterProvider {   

    public function filterPostRequest(FilterRequestModifier $request) {

        if (!empty($_REQUEST['recenter_x']) && !empty($_REQUEST['recenter_y'])) {
            $request->setValue('recenter_scale', '20000');
            $request->setValue('recenter_doit', '1');
        }
    }
}

if you use id recentering, simply modify/complet the condition to check id_recenter_ids existance

regards
Oliver
  ----- Original Message ----- 
  From: Alessandro Muzzetta 
  To: Cartoweb-users at lists.maptools.org 
  Sent: Thursday, January 24, 2008 1:42 PM
  Subject: [Cartoweb-users] Zooming in after recenter


  Dear Cartoweb users,

  I have followed the recentering example in Cartoweb to recenter the map on a specific (x,y) coordinate.
  However, if the map is fully shown, then nothing happens.  Only if it is already zoomed does the recentering move the map, which is a logical thing.  How can I make the map zoom to a specified level before recentering? 

  Thanks for any help

  -- 
  Alessandro Muzzetta
  IES Solutions Srl
  Catania Office
  Via Vulcano 10 - I-95030 Gravina di Catania, Italy
  Email: a.muzzetta at i4es.it 
  Phone/Fax: +39 095211640
  Skype: alex-tecnia 


------------------------------------------------------------------------------


  _______________________________________________
  Cartoweb-users mailing list
  Cartoweb-users at lists.maptools.org
  http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080204/8b10fa74/attachment.html


More information about the Cartoweb-users mailing list