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 <[email protected]> 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 <[email protected]> > 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: [email protected] > [mailto:[email protected]] 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 > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
