Skip to content

Commit

Permalink
Merge pull request #14853 from ahocevar/raster-missing-tiles
Browse files Browse the repository at this point in the history
Avoid missing tiles for Raster source using Tile layers or sources
  • Loading branch information
ahocevar committed Jun 22, 2023
2 parents 53dbb10 + 6618a38 commit 1051e8a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ol/source/Raster.js
Expand Up @@ -768,6 +768,8 @@ class RasterSource extends ImageSource {
return null;
}

this.tileQueue_.loadMoreTiles(16, 16);

resolution = this.findNearestResolution(resolution);
const frameState = this.updateFrameState_(extent, resolution, projection);
this.requestedFrameState_ = frameState;
Expand All @@ -791,8 +793,6 @@ class RasterSource extends ImageSource {
this.processSources_();
}

frameState.tileQueue.loadMoreTiles(16, 16);

if (frameState.animate) {
requestAnimationFrame(this.changed.bind(this));
}
Expand Down Expand Up @@ -869,15 +869,16 @@ class RasterSource extends ImageSource {
}
context.putImageData(output, 0, 0);

this.changed();
if (frameState.animate) {
requestAnimationFrame(this.changed.bind(this));
} else {
this.changed();
}
this.renderedRevision_ = this.getRevision();

this.dispatchEvent(
new RasterSourceEvent(RasterEventType.AFTEROPERATIONS, frameState, data)
);
if (frameState.animate) {
requestAnimationFrame(this.changed.bind(this));
}
}

/**
Expand Down

0 comments on commit 1051e8a

Please sign in to comment.