Merge pull request #12976 from mike-000/WebGL-ReprojTile

Handle ReprojTile in ol/layer/WebGLTile
This commit is contained in:
Tim Schaub
2021-11-16 09:40:00 -07:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -512,7 +512,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
* @param {import("../../PluggableMap.js").FrameState} frameState Frame state.
*/
const postRenderFunction = function (map, frameState) {
tileSource.expireCache(tileSource.getProjection(), empty);
tileSource.expireCache(frameState.viewState.projection, empty);
};
frameState.postRenderFunctions.push(postRenderFunction);

View File

@@ -5,6 +5,7 @@
import EventTarget from '../events/Target.js';
import EventType from '../events/EventType.js';
import ImageTile from '../ImageTile.js';
import ReprojTile from '../reproj/Tile.js';
import TileState from '../TileState.js';
import WebGLArrayBuffer from './Buffer.js';
import {ARRAY_BUFFER, STATIC_DRAW} from '../webgl.js';
@@ -152,7 +153,7 @@ class TileTexture extends EventTarget {
const gl = helper.getGL();
const tile = this.tile;
if (tile instanceof ImageTile) {
if (tile instanceof ImageTile || tile instanceof ReprojTile) {
const texture = gl.createTexture();
this.textures.push(texture);
this.bandCount = 4;