Fix tile pyramid getData()
This commit is contained in:
@@ -18,7 +18,12 @@ import {
|
|||||||
scale as scaleTransform,
|
scale as scaleTransform,
|
||||||
translate as translateTransform,
|
translate as translateTransform,
|
||||||
} from '../../transform.js';
|
} from '../../transform.js';
|
||||||
import {containsCoordinate, getIntersection, isEmpty} from '../../extent.js';
|
import {
|
||||||
|
boundingExtent,
|
||||||
|
containsCoordinate,
|
||||||
|
getIntersection,
|
||||||
|
isEmpty,
|
||||||
|
} from '../../extent.js';
|
||||||
import {
|
import {
|
||||||
create as createMat4,
|
create as createMat4,
|
||||||
fromTransform as mat4FromTransform,
|
fromTransform as mat4FromTransform,
|
||||||
@@ -713,16 +718,28 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const source = layer.getRenderSource();
|
// determine last source suitable for rendering at coordinate
|
||||||
const tileGrid = source.getTileGridForProjection(viewState.projection);
|
const sources = layer.getSources(
|
||||||
if (!source.getWrapX()) {
|
boundingExtent([coordinate]),
|
||||||
|
viewState.resolution
|
||||||
|
);
|
||||||
|
let i, source, tileGrid;
|
||||||
|
for (i = sources.length - 1; i >= 0; --i) {
|
||||||
|
source = sources[i];
|
||||||
|
if (source.getState() === State.READY) {
|
||||||
|
tileGrid = source.getTileGridForProjection(viewState.projection);
|
||||||
|
if (source.getWrapX()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
const gridExtent = tileGrid.getExtent();
|
const gridExtent = tileGrid.getExtent();
|
||||||
if (gridExtent) {
|
if (!gridExtent || containsCoordinate(gridExtent, coordinate)) {
|
||||||
if (!containsCoordinate(gridExtent, coordinate)) {
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i < 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const tileTextureCache = this.tileTextureCache_;
|
const tileTextureCache = this.tileTextureCache_;
|
||||||
for (
|
for (
|
||||||
|
|||||||
Reference in New Issue
Block a user