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

Bart van den Eijnden bartvde at boundlessgeo.com
Fri Dec 20 00:04:54 PST 2013


It does work. Maybe there is something wrong with your SLD?

Have you verified that your SLD works if you use it in GeoServer as the default style?

Bart

--
Bart van den Eijnden
Front-end Developer | Boundless
@boundlessgeo

On 20 Dec 2013, at 05:56, shiva subramanya <shiv at atree.org> wrote:

> 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
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131220/c68c19e4/attachment.html>


More information about the Users mailing list