Skip to content

Commit

Permalink
look for loaded parent tiles in cache
Browse files Browse the repository at this point in the history
This reduces the amount of the view not covered by tiles.
It makes tile loading look a lot faster.

It helps a lot when you:
- zoom in and the pan around
- zoom in quickly and then zoom out more slowly

ref #1918
  • Loading branch information
ansis committed Feb 19, 2016
1 parent 00e4e04 commit e6cb15c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/source/tile_pyramid.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ TilePyramid.prototype = {
var tile = this._tiles[coord.id];
if (tile && tile.loaded) {
retain[coord.id] = true;
return tile;
return true;
}
if (this._cache.has(coord.id)) {
this.addTile(coord);
retain[coord.id] = true;
return true;
}
}
},
Expand Down

0 comments on commit e6cb15c

Please sign in to comment.