Unfortunately both methods will add complexity to your client. Things
would be a little easier for you if the GeoServer PutStyles/GetStyles
operations were implemented, but they aren't at this time unfortunately.
How are you interacting with the server on the client side?
So, if I have understood well, first I make my default style, and in the
same rule, I need to add a new empty rule (by default at first), which
will be used to highlight features. But then, how can this highlight
rule be changed through parameters (SLD_BODY, STYLES or SLD)?
Yup, you can start with the normal "default" style. And then in the
FeatureTypeStyle that is being used, you can add a second rule which
contains a filter that is engaged only for the highlighted features:
<FeatureTypeStyle>
...
<Rule>
... contains symbolizers for default style
</Rule>
<Rule>
<ogc:Filter>
<ogc:FeatureId fid="<the feature you want to highlight>"/>
</ogc:Filter>
... symbolizer(s) for highlighted feature
</Rule>
...
</FeatureTypeStyle>
So to make it work you would have to build up this sld document for
every request, or keep a "prototype" of some sort around and for each
request with a highlighted feature set the filter accordingly, and then
serialize the document into the SLD_BODY param.
Another way could be to make two requests. One with the default style,
and one with the style for the highlighted features.
But this way I will be adding a lot of complexity in my client side, I
will need one highlight layer for every one.
Yeah... although you would not have to worry about keeping the default
style around on the client, that can be strictly managed by the server
and you can just reference it by name. That way you just have to worry
about the highlighted style.
Unfortunately neither alternative is particularly nice is it :). However
I could be missing another way to engage two styles simultaneously in
GeoServer, but nothing comes to mind...
Thank you for your help.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:1004,45e44bcb275191804284693!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org