Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Openlayers 3 ol3在时间变化后更新层_Openlayers 3 - Fatal编程技术网

Openlayers 3 ol3在时间变化后更新层

Openlayers 3 ol3在时间变化后更新层,openlayers-3,Openlayers 3,我想用ol.source.TileWMS作为源刷新我的ol.layer.Tile,但调用source.updateParams没有效果,chrome inspector工具也不会显示网络活动,例如geoserver请求。那么诀窍在哪里呢 我使用ol v3.16.0您可以使用参数样式的参数 例如: var params = {LAYERS: layerId, VERSION: '1.3.0', STYLES: style}; var source = layer.getSource(); sour

我想用ol.source.TileWMS作为源刷新我的ol.layer.Tile,但调用source.updateParams没有效果,chrome inspector工具也不会显示网络活动,例如geoserver请求。那么诀窍在哪里呢


我使用ol v3.16.0

您可以使用参数样式的参数

例如:

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

在内部,style是geoserver中的style名称,我通过升级到v3.18.2解决了这个问题