Skip to content

Commit

Permalink
fix #5491 symbol fading across tile reloads
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis committed Nov 3, 2017
1 parent bb0e874 commit 1ef3cdb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/symbol/cross_tile_symbol_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,18 @@ class CrossTileSymbolLayerIndex {
}
}

const oldTileIndex = this.indexes[coord.z] && this.indexes[coord.z][coord.id];
if (oldTileIndex) {
// mark labels in the old version of the tile as blocked
this.blockLabels(tileIndex, oldTileIndex, true);

// remove old version of the tile
this.removeTile(coord, sourceMaxZoom);
}

// make this tile block duplicate labels in lower-res parent tiles
let parentCoord = coord;
for (let z = coord.z - 1; z >= minZoom; z--) {
parentCoord = (parentCoord: any).parent(sourceMaxZoom);
const parentCoord = coord.scaledTo(z, sourceMaxZoom);
const parentIndex = this.indexes[z] && this.indexes[z][parentCoord.id];
if (parentIndex) {
// Mark labels in the parent tile blocked, and copy opacity state
Expand Down

0 comments on commit 1ef3cdb

Please sign in to comment.