Do not render layer when outside extent

This commit is contained in:
Andreas Hocevar
2021-08-10 20:01:20 +02:00
parent e7dfcc77ae
commit 394873013c

View File

@@ -26,6 +26,7 @@ import {
import {fromUserExtent} from '../../proj.js';
import {getIntersection} from '../../extent.js';
import {getUid} from '../../util.js';
import {isEmpty} from '../../extent.js';
import {numberSafeCompareFunction} from '../../array.js';
import {toSize} from '../../size.js';
@@ -207,6 +208,9 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
fromUserExtent(layerState.extent, viewState.projection)
);
}
if (isEmpty(extent)) {
return;
}
const tileLayer = this.getLayer();
const tileSource = tileLayer.getSource();