Merge pull request #10474 from mike-000/patch-2

Fix for undefined source in Image layer
This commit is contained in:
Andreas Hocevar
2020-03-11 18:05:29 +01:00
committed by GitHub
+13 -9
View File
@@ -55,16 +55,20 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
} }
if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] && !isEmpty(renderedExtent)) { if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] && !isEmpty(renderedExtent)) {
let projection = viewState.projection; if (imageSource) {
if (!ENABLE_RASTER_REPROJECTION) { let projection = viewState.projection;
const sourceProjection = imageSource.getProjection(); if (!ENABLE_RASTER_REPROJECTION) {
if (sourceProjection) { const sourceProjection = imageSource.getProjection();
projection = sourceProjection; if (sourceProjection) {
projection = sourceProjection;
}
} }
} const image = imageSource.getImage(renderedExtent, viewResolution, pixelRatio, projection);
const image = imageSource.getImage(renderedExtent, viewResolution, pixelRatio, projection); if (image && this.loadImage(image)) {
if (image && this.loadImage(image)) { this.image_ = image;
this.image_ = image; }
} else {
this.image_ = null;
} }
} }