Merge pull request #5595 from ahocevar/wanted-tile-keys

Use tile keys instead of coord keys
This commit is contained in:
Andreas Hocevar
2016-07-14 13:26:09 +02:00
committed by GitHub
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -937,8 +937,7 @@ ol.Map.prototype.getTilePriority = function(tile, tileSourceKey, tileCenter, til
if (!frameState || !(tileSourceKey in frameState.wantedTiles)) { if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {
return ol.structs.PriorityQueue.DROP; return ol.structs.PriorityQueue.DROP;
} }
var coordKey = tile.tileCoord.toString(); if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {
if (!frameState.wantedTiles[tileSourceKey][coordKey]) {
return ol.structs.PriorityQueue.DROP; return ol.structs.PriorityQueue.DROP;
} }
// Prioritize the highest zoom level tiles closest to the focus. // Prioritize the highest zoom level tiles closest to the focus.
+1 -1
View File
@@ -311,7 +311,7 @@ ol.renderer.Layer.prototype.manageTilePyramid = function(
if (currentZ - z <= preload) { if (currentZ - z <= preload) {
tile = tileSource.getTile(z, x, y, pixelRatio, projection); tile = tileSource.getTile(z, x, y, pixelRatio, projection);
if (tile.getState() == ol.TileState.IDLE) { if (tile.getState() == ol.TileState.IDLE) {
wantedTiles[tile.tileCoord.toString()] = true; wantedTiles[tile.getKey()] = true;
if (!tileQueue.isKeyQueued(tile.getKey())) { if (!tileQueue.isKeyQueued(tile.getKey())) {
tileQueue.enqueue([tile, tileSourceKey, tileQueue.enqueue([tile, tileSourceKey,
tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]); tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]);
+1 -1
View File
@@ -84,7 +84,7 @@ ol.Tile.prototype.getImage = goog.abstractMethod;
* @return {string} Key. * @return {string} Key.
*/ */
ol.Tile.prototype.getKey = function() { ol.Tile.prototype.getKey = function() {
return goog.getUid(this).toString(); return this.key + '/' + this.tileCoord;
}; };