Introduce EMPTY image state to deal with images outside the view extent
This commit is contained in:
@@ -9,5 +9,6 @@ export default {
|
|||||||
IDLE: 0,
|
IDLE: 0,
|
||||||
LOADING: 1,
|
LOADING: 1,
|
||||||
LOADED: 2,
|
LOADED: 2,
|
||||||
ERROR: 3
|
ERROR: 3,
|
||||||
|
EMPTY: 4
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -51,10 +51,7 @@ class ReprojImage extends ImageBase {
|
|||||||
|
|
||||||
const sourceExtent = triangulation.calculateSourceExtent();
|
const sourceExtent = triangulation.calculateSourceExtent();
|
||||||
const sourceImage = getImageFunction(sourceExtent, sourceResolution, pixelRatio);
|
const sourceImage = getImageFunction(sourceExtent, sourceResolution, pixelRatio);
|
||||||
let state = ImageState.LOADED;
|
const state = sourceImage ? ImageState.IDLE : ImageState.EMPTY;
|
||||||
if (sourceImage) {
|
|
||||||
state = ImageState.IDLE;
|
|
||||||
}
|
|
||||||
const sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;
|
const sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;
|
||||||
|
|
||||||
super(targetExtent, targetResolution, sourcePixelRatio, state);
|
super(targetExtent, targetResolution, sourcePixelRatio, state);
|
||||||
|
|||||||
Reference in New Issue
Block a user