6

How to change predefile SLD in client side? The reason I want this is I want to turn label on and off on client side.

3 Answers 3

4

Easiest way is to have two SLD files and change the style in the WMS request depending on if you want labels on or off.

Alternatively you could have a separate layer with just labels and turn that on/off as needed.

Or you could try to have a local SLD file and upload it with each request but that will be slower and much harder to handle on the client.

0

you should look Styled Layer Descriptor (SLD) example on openlayers here about parsing SLD and applying styles to a vector layer of course you will use in openlayers..

i hope it helps you...

0

I am trying to do the same. I came across the post.

http://underdark.wordpress.com/2010/06/10/dynamic-styling-and-filtering-of-a-geoserver-wms-using-openlayers-layer-wms-post/

Unfortunately, I haven't had luck to make it work.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.