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.


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.


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...


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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