[Users] How to feed a Grid from several WFS Layers

Matt Priour mpriour at kestrelcomputer.com
Tue May 18 17:34:22 CEST 2010


You could TRY to configure your FeatureStore with a 
OpenLayers.Layer.Vector.RootContainer layer in the store's layer property. 
I'm not sure that would actually work. The documentation warns that this 
layer is not supposed to be instantiated by user code, but I've not had any 
problems with it as long as I instantiate it after the layers have been 
added to the map and do not actually add the RootContainer layer itself to 
the map.

An other option that would be easy is to make a factory function for 
creating your WFS vector layers that automatically adds the 2 event 
listeners to your WFS layers, rather than have to add that code to each and 
every layer that you are configuring.

Matt Priour
Kestrel Computer Consulting


From: Florent Coste
Sent: Tuesday, May 18, 2010 10:10 AM
To: Andreas Hocevar
Cc: users at geoext.org Users
Subject: Re: [Users] How to feed a Grid from several WFS Layers


Hello All.

@Andreas : yes for the moment this is exactly what i use (same WFS server, 
enumerated feature list), but this breaks the functionnality i want to have 
"if i deactivate a layer on my map, the grid should be updated accordingly." 
I don't want to add extra layer switching menu, the user should use the 
standard OpenLayers/French Geoportail layer switcher.

@Matt : thank you for the plumbing tip. From my point of view, the design 
would me more at the Vector level : could not it be possible to write a 
Vector implementation  that is a Composite (like the design pattern) of 
several Vector instances ?


2010/5/18 Andreas Hocevar <ahocevar at opengeo.org>

Hi,

if your WFS supports multiple feature types per request, you should also be 
able to configure your OpenLayers vector layer with a comma separated list 
of feature types. The requirement, of course, is that all WFS layers are on 
the same server and have the same namespace.

Regards,
Andreas.


On May 18, 2010, at 14:36 , Matt Priour wrote:

> You need to use a feature store for your grid that contains all of the 
> features you want to use.
> To do this you will need to add a 'featuresadded' & 'featuresremoved' 
> event listeners to your WFS layers that append or remove the features from 
> the feature store.
> A feature store typically syncrhonizes with a single layer, which is what 
> is happening in your current Grid, however to synchronize with multiple 
> layers, you will have to provide a bit of the plumbing yourself.
> Matt Priour
> Kestrel Computer Consulting
>
> From: Florent Coste
> Sent: Tuesday, May 18, 2010 4:43 AM
> To: users at geoext.org
> Subject: [Users] How to feed a Grid from several WFS Layers
>
> Hello
>
> I'm able to synchronize a Grid with a WFS layer linked to a Map, but how 
> to do with several WFS layers ?
> I want to have the possibility to deactiviate/activate each layer one by 
> one
>
> All the WFS layers have the same properties so they can all be displayed 
> correctly in the grid.
> I have searched in the API without success
>
> Regards,
> Florent
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users




--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.







_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users 



More information about the Users mailing list