【问题标题】:OL3: How to clear the cache of a ImageWMS layer while waiting for updateParams to return an updated layerOL3:如何在等待 updateParams 返回更新后的图层时清除 ImageWMS 图层的缓存
【发布时间】:2016-02-02 17:02:53
【问题描述】:

在 OpenLayers 3 中对 ImageWMS 调用 source.updateParams() 时,当前图层不会立即清除,它会等待新参数成功返回结果,然后再移除当前图像并用新结果替换它。我正在寻找一种方法来立即清除当前缓存的图像,以便用户在等待新图像时看不到旧图像。我试过关闭能见度然后再打开,但这不起作用。各种方法都试过了

source.dispatchEvent('change')
source.changed()
source.setImageLoadFunction(source.getImageLoadFunction())

但它们都没有奏效。我能够模拟我正在寻找的唯一方法是在用户更新参数后立即将图层的不透明度设置为 0,然后重新打开不透明度

theimageloadend

来自源的事件。

【问题讨论】:

    标签: javascript openlayers-3


    【解决方案1】:

    在 OL6 中:

    layer.renderer_.image_ = null;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-09
      • 2014-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-28
      • 1970-01-01
      相关资源
      最近更新 更多