diff --git a/src/tiledimage.js b/src/tiledimage.js index 42319144..0bedb701 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -1930,8 +1930,8 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag return [tile]; } previousBest.push(tile); + this._sortTiles(previousBest); if (previousBest.length > maxNTiles) { - this._sortTiles(previousBest); previousBest.pop(); } return previousBest;