2

I changing layer's style via REST api:

curl.exe -v -u new_user:123456 -XPUT -H "Content-type: text/xml" 
-d "<layer><defaultStyle><name>poi</name></defaultStyle></layer>" 
http://localhost:8080/geoserver/rest/layers/cite:point

Style changing, but in layer's Publishing tab i see that layer sets not enabled.

enter image description here

How can i fix it?

2

You can force the layer to be enabled by adding an enabled-element with a value of true to the layer-element. So your cURL PUT-request should look like this:

curl.exe -v -u new_user:123456 -XPUT -H "Content-type: text/xml" 
-d "<layer><defaultStyle><name>poi</name></defaultStyle><enabled>true</enabled></layer>" 
http://localhost:8080/geoserver/rest/layers/cite:point
  • Yeah your code it's only way for now. I get same answer in geoserver mail list. – Kliver Max Oct 23 '13 at 17:44
  • The same happened for me when updating the feature type and adding the enabled element helped: <featureType><enabled>true</enabled></featureType>. Thanks. – ulrich Jan 4 '17 at 16:14

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.