Introduce EMPTY image state to deal with images outside the view extent

This commit is contained in:
ahocevar
2019-07-26 13:00:35 +02:00
parent 1cc92b4751
commit 62d8760420
2 changed files with 3 additions and 5 deletions

View File

@@ -51,10 +51,7 @@ class ReprojImage extends ImageBase {
const sourceExtent = triangulation.calculateSourceExtent();
const sourceImage = getImageFunction(sourceExtent, sourceResolution, pixelRatio);
let state = ImageState.LOADED;
if (sourceImage) {
state = ImageState.IDLE;
}
const state = sourceImage ? ImageState.IDLE : ImageState.EMPTY;
const sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;
super(targetExtent, targetResolution, sourcePixelRatio, state);