[Cartoweb-users] how to change layer selection by code in a plugIn

giuseppe.derossi at email.it giuseppe.derossi at email.it
Mon Aug 27 20:15:19 EDT 2007


Hi Oliver,
I red the doc, but I was not able to get my target. 
I performed some tests amd I send you my code. Only the recenter option
works well.
My plugIn let the user to choose a name of a building which has been
selected by a quary and linked to recenterBox, so when the user click on one
item of the displayed list of buildings the map is recentered on it.
I'm working on Cartoweb 3.2 in Win env.I tried to put the values in a direct
mode both with one-quote and double quotes and as int value (for the
crosshair 1 or '1' or "1" , but nothing ... in $sel_layers there is the real
name of the layer and not the label. I tried both with a group name and with
a list of elementary layers .
Any suggestion/correction ?

thanks in advance and best regards

Giu

class myNewPlugin extends  ClientPlugin implements  Sessionable,
GuiProvider, FilterProvider 
{
...

 public function filterPostRequest(FilterRequestModifier $request) {

...
   $recenterBbox= "$x1, $y1, $x2, $y2";
   $cross_ok ="1";
   $sel_layers="CAR_Group,VIN_layer_1,VIN_layer_2,VIN_layer_2";
	      
   $request->setValue('show_crosshair',  $cross_ok);
   $request->setValue('recenter_scale',  "2000");
   $request->setValue('recenter_bbox', $recenterBbox); 
   $request->setValue('layer_select',$sel_layers);
	     

 }

...


}

	--------- Original Message --------
	Da: Oliver Christen <oliver.christen at camptocamp.com>
	To: cartoweb-users at lists.maptools.org <cartoweb-users at lists.maptools.org>
	Oggetto: Re: [Cartoweb-users] how to change layer selection by code in a
plugIn
	Data: 27/08/07 11:24
	
	> 
> 
> 
> Hi
> 
> maybe you can use the filter layer_select and layer_unselect
> see 
>
http://www.cartoweb.org/doc_head/docbook/xhtml/dev.newplugin.html#dev.newplugin.special.filters
> 
> regards
> Oliver
> 
> 
> 
> > Hi,
> > I'd like to know if there is a way that forces a layer to be hidden or
> > displayed by code ie: I wrote a plugin which returns a list of buildings
> > which have all a common item,this item is also represented by a layer.
Now
> > I'd like that on quering into my db, if there are buildings which
matches 
> > an
> > item, I can set a layer to be displayed.
> > Thanks in advance
> > Giu
> > --
> > Email.it, the professional e-mail, gratis per te: http://www.email.it/f
> >
> > Sponsor:
> > In REGALO un GIOCO! Scegli GPBikes 3D,Bubble Boom, Rock City Empire
> > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6732&d=20070827
> >
> >
> > _______________________________________________
> > Cartoweb-users mailing list
> > Cartoweb-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/cartoweb-users
> > 
> 
> 
> 
>  
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Entra in Mondolastminute, centinaia di offerte ti aspettano per le tue
vacanze a prezzi lastminute!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6851&d=20070828




More information about the Cartoweb-users mailing list