Thanks a lot for your answer. The "styles-context" example is exactly was I was looking for ! It's gonna help me a lot with my project. So problem 1 is now solved, thanks again.
Does anyone have an idea regarding problem 2 ? " 2/ I managed to display a popup when features are selected by an user thanks to adding an OpenLayers.Control.SelectFeature to my WFS layer. But I'd like to display another popup (or a contextual menu) when the user right clicks on a feature. Is there a way to register the "rightclick event" on features ? " Maybe I could do it with rewriting my own "SelectFeature" so that it handles right-click ? Maybe I could handle right click on the whole layer and then capture mouse position to know if there is a feature underneath ? These are the only two hints I think about for the moment. Thanks a lot. Arnaud. 2010/9/23 Arnd Wippermann <[email protected]> > Hi, > > you can style features by rules (i.e created from attributes, zoomlevel, > etc.) or apply a style to single features. > > > > http://dev.openlayers.org/releases/OpenLayers-2.10/examples/styles-unique.html > > http://dev.openlayers.org/releases/OpenLayers-2.10/examples/style-rules.html > > http://dev.openlayers.org/releases/OpenLayers-2.10/examples/styles-context.html > > Arnd > > ------------------------------ > *Von:* [email protected] [mailto: > [email protected]] *Im Auftrag von *Arnaud Estève > *Gesendet:* Donnerstag, 23. September 2010 14:32 > *An:* [email protected] > *Betreff:* [OpenLayers-Users] Styling features on a WFS layer and > handlingright-click on a WFS layer > > Hi everybody, > > First of all congratulations for your job on OpenLayers, it's really a > great library. > > I have two main problems working with a WFS layer and I did'nt manage to > find an issue on the internet. I'm working with a PostGIS database, my web > geographic server is Geoserver and I'm using OpenLayers on the client side. > > 1/ I managed to display my own style (icon) for the points belonging to my > WFS layer. But I'd like to display 2 different icons depending on a field > (like "outOfOrder : true or false") in the PostGIS database. As there is > only one table in my database, I can't display two different layers. I tried > to "fake" a second table using a view (filtered with the mentionned field) > but in this case Geoserver refuses to save modified features to the database > 'cause the view doesn't own a primary key. > So I'd like to know if there is a way, on the same WFS layer to display two > differents styles for the geometries depending on their fid for example. > I know this is possible if I use markers (markers can be styled > one-by-one), but I'd really like to use a WFS layer as users can modify > geometries. > 2/ I managed to display a popup when features are selected by an user > thanks to adding an OpenLayers.Control.SelectFeature to my WFS layer. But > I'd like to display another popup (or a contextual menu) when the user right > clicks on a feature. > Is there a way to register the "rightclick event" on a given feature ? > > Once again, thanks for your job, classes are well-documented and examples > are self-understandable, though I managed to do a lot of things by myself > but I'm really stuck with those two problems. > > Thanks in advance for your answers. >
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
