[英]OL3: How to clear the cache of a ImageWMS layer while waiting for updateParams to return an updated layer
在 OpenLayers 3 中對 ImageWMS 調用 source.updateParams() 時,當前層不會立即清除,它會等待新參數成功返回結果,然后移除當前圖像並用新結果替換它。 我正在尋找一種方法來立即清除當前緩存的圖像,以便用戶在等待新圖像的同時看不到舊圖像。 我曾嘗試關閉可見性然后重新打開,但這不起作用。 我嘗試了各種方法
source.dispatchEvent('change')
source.changed()
source.setImageLoadFunction(source.getImageLoadFunction())
但他們都沒有工作。 我能夠模擬我正在尋找的唯一方法是在用戶更新參數后立即將圖層的不透明度設置為 0,然后重新打開不透明度
theimageloadend
從源頭事件。
在 OL6 中:
layer.renderer_.image_ = null;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.