Hello everybody,

I ended up creating a new OpenLayers vector layer and added the features from my multiple WFS layers to this layer, using the layer.addFeatures method. This works well enough, I draw only the new layer in the map and the features are combined on the map as well as in the data grid.

Greetings,
Frans

On 2010-09-23 10:29, Andreas Hocevar wrote:
Hi,

I would not suggest messing with the RootContainer. Personally, I would create 
a custom strategy that takes care of fetching features from your different 
sources. This custom strategy would probably maintain its own 
OpenLayers.Protocol instances, and your layer would not be configured with a 
protocol.

Regards,
Andreas.

On Sep 23, 2010, at 09:55 , Frans Knibbe wrote:

Hello Andreas,

Thank you for your thoughts. However, I don't think your suggestion will work 
in my case. I am not trying to merge different feature types from one WFS, but 
the same feature type from different WFSes.

Regards,
Frans

On 2010-09-23 9:41, Andreas Hocevar wrote:
Hi,

configure your WFS protocol with multiple feature types. Look e.g. at the wfs-states.js example. If 
you wanted "states" and "world" from the WFS, you would configure it like this:

     var wfs = new OpenLayers.Layer.Vector("States", {
         strategies: [new OpenLayers.Strategy.BBOX()],
         protocol: new OpenLayers.Protocol.WFS({
             url: "http://demo.opengeo.org/geoserver/wfs";,
             featureType: ["states", "world"],
             featureNS: "http://www.openplans.org/topp";
         })
     });

Regards,
Andreas.

On Sep 22, 2010, at 18:38 , Frans Knibbe wrote:

Hello everybody,

I have several vector layers that have similar data structures (in fact they 
are WFS layers using the same application schemas). I would like to merge these 
layers into one layer. I want to do this because I want to use a 
GeoExt.data.FeatureStore to be able to display a table with feature data that 
are coupled with the features in the map. So I think I want to use only the 
merged layer in my map.

I am looking for help on the best way to merge my vector layers. Looking at the 
OpenLayers documentation, I see that I could use the addFeatures function to add features 
to the merged layer. But when could I call this function if I never draw the layers that 
will be merged? On the other hand, I see there is a 
OpenLayers.Layer.Vector.RootContainer. It is something that can be used to combine vector 
layers but it is "not supposed to be instantiated from user space".

Any help, tips, examples or hints will be greatly appreciated!

Greetings,
Frans


_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to