[OpenLayers-Users] All vector features in one WFS layer

Alexandre Dube adube at mapgears.com
Tue Nov 4 14:09:09 EST 2008


We found a workaround ( thanks to my colleagues Daniel and Julien ).

  My data is originally from MapInfo.  I just opened each table to add a 
column named "Type" and gave a unique value for each one.  Then, in OL, 
used the addUniqueValueRules using the new "Type" attribute they all share.

  Manipulate data is a harsh way ( in my opinion ), but it works so why 
bother ?

Alexandre
 

Alexandre Dube wrote:
> Hi list,
>
>   I have some data from different sources I want to put in the same WFS 
> vector layer to be able to interact with all of them at the same time.  
> I would like to give each source a single unique style.  I know how to 
> do that with a single source of data using addUniqueValueRules function, 
> but I would like something more like "if this features comes from that 
> source, draw using this style", or like "if this feature as an 
> attributes called something, draw with this style".  Is that possible ?
>
>   Also, I would like each source to be in the layerSwitcher.  What I 
> thought so far to resolve that is creating a dummy layer for each 
> source, register a "onVisibilityChange" event that would change the 
> "style" to nothing if uncheck ( or to its original style on check ) and 
> redraw the whole layer.  I think that could do it, but I would be long 
> to redraw everything every time.  Any thought ?
>
>   I saw the "One Single - Mother of all vector" example, but don't think 
> it can helps here.  I need to figure a way to give a unique style for 
> each data source...
>
>   An other option could be to create a WFS layer for each data source ( 
> as normal ) and add a little control panel to toggle which one is on 
> top.  But I would prefer my first option ( if possible ).
>
>   Anybody have any better idea ?
>   Are my ideas ok ?
>   Can I give a unique style for each data source ?
>
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list