Monday, 31 July 2017

geoserver - OpenLayers 3 - submit SLD text in WMS call


Earlier versions of OpenLayers allowed for the submission of the text of an SLD in a call to the server side WMS.


This describes the procedure, and cautions that, if your SLD is too long, you might have to use POST rather than GET.


Documentation on how to do this with OpenLayers 3 seems to be hard to find. Is it still possible to do this?


I did find that you can specify an SLD defined & stored within GeoServer by way of the STYLES property of the params argument to, for example, the ol.source.TileWMS.


I need to dynamically create the text of an SLD on the client side (within JavaScript) and submit this in my calls to get tiled maps from GeoServer.


Prior to OL 3, you could submit your SLD text with the SLD_BODY: parameter, but this does not seem to work, at least in the ol.source.TileWMS constructor. I guess the crux of my problem is that the params object is not very well documented.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...