简体   繁体   中英

ol3 update layer after time change

I want to refresh my ol.layer.Tile with an ol.source.TileWMS as source, but calling source.updateParams has no effects and chrome inspector tool doesn't show network activities, such as geoserver requests. So where is the trick?

I use ol v3.16.0

You can using the params with parameter STYLE

For example:

var params = {LAYERS: layerId, VERSION: '1.3.0', STYLES: style};
var source = layer.getSource();
source.updateParams(params); 

Inside, style is the name of style in the geoserver

我通过升级到v3.18.2解决了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM