I have a GeoServer map request for which I want to use an alternate style...
https://xyz.com/geoserver/wms?LAYERS=earth:WAYS&CQL_FILTER=[(USAGE IN ('X'))]&STYLES=STYLE2&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG:4326&TRANSPARENT=TRUE&_OLSALT=0.89383&BBOX=0,0,45,45&WIDTH=256&HEIGHT=256
I get back a No such style: STYLE2
If I run the request at the GeoServer layer preview and change the style in the URL, I get back the proper result. It's just that it doesn't work when I try it through my network call. I can change the style in the network call URL to the built-in 'point' style and it works without problem. The only thing I can think of is that Geoserver is not looking in my workspace for the style, but rather the built-in, generic workspace where 'point' is stored. Perhaps there is a prefix I can place on the styles parameter, such as: ...&styles=earth:STYLE2... Tried that, but it didn't work. I think I also tried defining STYLE2 as a secondary style in the layer, but that didn't work either. The style is definitely created as I can see it in the GUI list of styles and it works in the layer preview.
Any ideas for the proper syntax or what I might be doing wrong?