Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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