[OpenLayers-Users] changing sld's dynamically just not working

shiva subramanya shiv at atree.org
Thu Dec 19 20:56:38 PST 2013


I use openlayers with geoserver. Even though layer.mergeNewParams" does
seem to refresh the map, it still is picking up the default SLD which has
been set for the layer when it was published on geoserver. It doesnt seem
to be picking the new SLD being pointed to.

Does "mergeNewParams" for SLD work for geoserver at all, thats my doubt now?

Shiv


On Fri, Dec 20, 2013 at 12:25 AM, Arnd Wippermann <arnd.wippermann at web.de>wrote:

>  Hi Shiv,
>
> your code should work, but is your sld valid xml and is the named layer
> correct?
>
> If you request a MapServer layer, then in the mapfile sld must be enabled.
>
> Arnd
>
>
>
>  ------------------------------
> *Von:* openlayers-users-bounces at lists.osgeo.org [mailto:
> openlayers-users-bounces at lists.osgeo.org] *Im Auftrag von *shiva
> subramanya
> *Gesendet:* Mittwoch, 18. Dezember 2013 14:46
> *An:* openlayers-users
> *Betreff:* [OpenLayers-Users] changing sld's dynamically just not working
>
>     Hi
>
> I want to change SLD's dynamically on my map for the WMS layers with the
> following code.
>
>            var sldfile = 'http://myserver/resources/sld/test.sld';
>           layer.mergeNewParams({sld: sldfile,SLD_BODY: null});
>
> But the map refreshes when i execute this and the styles dont change.
>
> I checked the accessibility of the sld url and it is accessible on the
> network.
>
> I need some help to make this work.
>
> Thanks
>
> Shiv
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131220/69c3e1e0/attachment.html>


More information about the Users mailing list