[OpenLayers-Users] All vector features in one WFS layer
Alexandre Dube
adube at mapgears.com
Mon Nov 3 10:59:52 EST 2008
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