Let source set the key, like other sources do
This commit is contained in:
@@ -24,12 +24,11 @@ class VectorImageTile extends Tile {
|
|||||||
/**
|
/**
|
||||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {TileState} state State.
|
* @param {TileState} state State.
|
||||||
* @param {number} sourceRevision Source revision.
|
|
||||||
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
||||||
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
||||||
* @param {Object<string, import("./VectorTile.js").default>} sourceTiles Source tiles.
|
* @param {Object<string, import("./VectorTile.js").default>} sourceTiles Source tiles.
|
||||||
*/
|
*/
|
||||||
constructor(tileCoord, state, sourceRevision, urlTileCoord, sourceTileGrid, sourceTiles) {
|
constructor(tileCoord, state, urlTileCoord, sourceTileGrid, sourceTiles) {
|
||||||
|
|
||||||
super(tileCoord, state, {transition: 0});
|
super(tileCoord, state, {transition: 0});
|
||||||
|
|
||||||
@@ -99,8 +98,6 @@ class VectorImageTile extends Tile {
|
|||||||
* @type {Array<import("./events.js").EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.sourceTileListenerKeys_ = [];
|
this.sourceTileListenerKeys_ = [];
|
||||||
|
|
||||||
this.key = sourceRevision.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,9 +183,10 @@ class VectorImageTile extends Tile {
|
|||||||
for (let i = 0, ii = tileKeys.length; i < ii; ++i) {
|
for (let i = 0, ii = tileKeys.length; i < ii; ++i) {
|
||||||
this.sourceTiles_[tileKeys[i]].consumers++;
|
this.sourceTiles_[tileKeys[i]].consumers++;
|
||||||
}
|
}
|
||||||
const tile = new VectorImageTile(this.tileCoord, TileState.IDLE, Number(this.key),
|
const tile = new VectorImageTile(this.tileCoord, TileState.IDLE,
|
||||||
this.wrappedTileCoord, null, this.sourceTiles_);
|
this.wrappedTileCoord, null, this.sourceTiles_);
|
||||||
tile.extent = this.extent;
|
tile.extent = this.extent;
|
||||||
|
tile.key = this.key;
|
||||||
tile.tileKeys = tileKeys;
|
tile.tileKeys = tileKeys;
|
||||||
tile.context_ = this.context_;
|
tile.context_ = this.context_;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|||||||
@@ -213,11 +213,11 @@ class VectorTile extends UrlTile {
|
|||||||
const tile = new VectorImageTile(
|
const tile = new VectorImageTile(
|
||||||
tileCoord,
|
tileCoord,
|
||||||
urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,
|
urlTileCoord !== null ? TileState.IDLE : TileState.EMPTY,
|
||||||
this.getRevision(),
|
|
||||||
urlTileCoord,
|
urlTileCoord,
|
||||||
this.tileGrid,
|
this.tileGrid,
|
||||||
this.sourceTiles_);
|
this.sourceTiles_);
|
||||||
|
|
||||||
|
tile.key = this.getRevision().toString();
|
||||||
this.assignTiles(tile, pixelRatio, projection);
|
this.assignTiles(tile, pixelRatio, projection);
|
||||||
this.tileCache.set(tileCoordKey, tile);
|
this.tileCache.set(tileCoordKey, tile);
|
||||||
return tile;
|
return tile;
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
|||||||
sourceTile.getImage = function() {
|
sourceTile.getImage = function() {
|
||||||
return document.createElement('canvas');
|
return document.createElement('canvas');
|
||||||
};
|
};
|
||||||
const tile = new VectorImageTile([0, 0, 0], undefined, 1, [0, 0, 0], createXYZ(), {'0,0,0': sourceTile});
|
const tile = new VectorImageTile([0, 0, 0], 1, [0, 0, 0], createXYZ(), {'0,0,0': sourceTile});
|
||||||
tile.transition_ = 0;
|
tile.transition_ = 0;
|
||||||
tile.tileKeys = ['0,0,0'];
|
tile.tileKeys = ['0,0,0'];
|
||||||
tile.extent = getProjection('EPSG:3857').getExtent();
|
tile.extent = getProjection('EPSG:3857').getExtent();
|
||||||
|
|||||||
Reference in New Issue
Block a user