I have a webpage that displays a GeoTIFF served via GeoServer as an OpenLayers3 ImageWMS
layer.
What I need is to (via a button) reload the OL3 layer after the underlying GeoTIFF changes.
I searched around, and tried
layer.dispatchChangeEvent();
on the layer in question. But the map/image isn't updated.
I have tried
1) removing the layer, constructing a new layer from the GeoTIFF and add it back using JavaScript.
2) disabling caching for the raster layer in GeoServer.
3) using layer.getSource().dispatchChangeEvent();
as suggested by @ahocevar's answer.
None solved the problem.
The only thing that works is to reload the whole webpage, in which case the map shows the new image but all states in the page is lost.
How can I reload the layer without having to reload the whole page?