On Fri, Jan 21, 2011 at 12:12 PM, IT Intern <[email protected]> wrote:
> I just recently resolved the issue of changing my layers style through
> OpenLayers using:
>
> myLayer.mergeNewParams({sld
> :'file:///usr/local/geoserver-2.0.2/data_dir/styles/myLayerSLD.sld', styles:
> null});
>
> and that works great if I am using WMS layers which are not cached by
> GeoWebCache.
>
> But if my layers are cached, using the above does not work. I have also
> tried using
>
> myLayer.redraw(true);
>
> Which is an OpenLayers library method that I believe is called automatically
> with the call to mergeNewParams, so I knew it wouldn't work.
>
> So now I am assuming that I have to set-up something in my GeoWebCache to
> accept dynamic SLD. Any ideas or hints?
If you're going to be requesting layer images with dynamic styling
then you can't use the cached version of the layer; the cached version
is pre-rendered with whatever styles were set on the layer in
geoserver and/or gwc. GWC *can* be set up to cache multiple versions
of a layer based on the values in the STYLES= (or any other) wms
parameter, but that won't work if you are using truly dynamic styles;
for example if you let the user choose arbitrarily style parameters on
the client side and build an SLD from that.
If your SLD really is dynamic you're going to have to use the
non-cached version of the layer. If your GWC and Geoserver layers map
1:1 with each other (which is true for a standard install without a
geowebcache.xml file) then just removing "gwc/service/" from the layer
URL will get you the non-cached version. For example:
gwc url: http://localhost:8080/geoserver/gwc/service/wms
non-cached url: http://localhost:8080/geoserver/wms
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users