Do not use tile.load() for getting source tiles
This commit is contained in:
@@ -167,10 +167,9 @@ class VectorRenderTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @return {Array<import("./VectorTile.js").default>} Source tiles for this tile.
|
|
||||||
*/
|
*/
|
||||||
load() {
|
load() {
|
||||||
return this.getSourceTiles_(this);
|
this.getSourceTiles_(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
|
|||||||
const resolution = tileGrid.getResolution(zoom);
|
const resolution = tileGrid.getResolution(zoom);
|
||||||
const tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
|
const tileExtent = tileGrid.getTileCoordExtent(tile.wrappedTileCoord);
|
||||||
|
|
||||||
const sourceTiles = tile.load();
|
const sourceTiles = source.getSourceTiles(pixelRatio, projection, tile);
|
||||||
const layerUid = getUid(layer);
|
const layerUid = getUid(layer);
|
||||||
const executorGroups = tile.executorGroups[layerUid];
|
const executorGroups = tile.executorGroups[layerUid];
|
||||||
if (executorGroups) {
|
if (executorGroups) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ describe('ol.source.VectorTile', function() {
|
|||||||
tile.load();
|
tile.load();
|
||||||
const key = listen(tile, 'change', function(e) {
|
const key = listen(tile, 'change', function(e) {
|
||||||
if (tile.getState() === TileState.LOADED) {
|
if (tile.getState() === TileState.LOADED) {
|
||||||
const sourceTile = tile.load()[0];
|
const sourceTile = source.getSourceTiles(1, source.getProjection(), tile)[0];
|
||||||
expect(sourceTile.getFeatures().length).to.be.greaterThan(0);
|
expect(sourceTile.getFeatures().length).to.be.greaterThan(0);
|
||||||
unlistenByKey(key);
|
unlistenByKey(key);
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ describe('ol.VectorRenderTile', function() {
|
|||||||
const key = listen(tile, EventType.CHANGE, function() {
|
const key = listen(tile, EventType.CHANGE, function() {
|
||||||
if (tile.getState() === TileState.LOADED) {
|
if (tile.getState() === TileState.LOADED) {
|
||||||
unlistenByKey(key);
|
unlistenByKey(key);
|
||||||
const sourceTiles = tile.load();
|
const sourceTiles = source.getSourceTiles(1, source.getProjection(), tile);
|
||||||
expect(sourceTiles.length).to.be(1);
|
expect(sourceTiles.length).to.be(1);
|
||||||
expect(sourceTiles[0].tileCoord).to.eql([0, 16, 9]);
|
expect(sourceTiles[0].tileCoord).to.eql([0, 16, 9]);
|
||||||
done();
|
done();
|
||||||
@@ -126,7 +126,7 @@ describe('ol.VectorRenderTile', function() {
|
|||||||
listenOnce(tile, 'change', function() {
|
listenOnce(tile, 'change', function() {
|
||||||
expect(tile.getState()).to.be(TileState.LOADED);
|
expect(tile.getState()).to.be(TileState.LOADED);
|
||||||
expect(tile.loadingSourceTiles).to.be(0);
|
expect(tile.loadingSourceTiles).to.be(0);
|
||||||
const sourceTiles = tile.load();
|
const sourceTiles = source.getSourceTiles(1, source.getProjection(), tile);
|
||||||
expect(sourceTiles.length).to.be(4);
|
expect(sourceTiles.length).to.be(4);
|
||||||
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
||||||
expect(sourceTiles[i].consumers).to.be(1);
|
expect(sourceTiles[i].consumers).to.be(1);
|
||||||
Reference in New Issue
Block a user