Add optional per-tile callback to manageTilePyramid
This commit is contained in:
@@ -297,10 +297,13 @@ ol.renderer.Layer.prototype.snapCenterToPixel =
|
|||||||
* @param {ol.Projection} projection Projection.
|
* @param {ol.Projection} projection Projection.
|
||||||
* @param {ol.Extent} extent Extent.
|
* @param {ol.Extent} extent Extent.
|
||||||
* @param {number} currentZ Current Z.
|
* @param {number} currentZ Current Z.
|
||||||
|
* @param {function(this: T, ol.Tile)=} opt_tileCallback Tile callback.
|
||||||
|
* @param {T=} opt_obj Object.
|
||||||
* @protected
|
* @protected
|
||||||
|
* @template T
|
||||||
*/
|
*/
|
||||||
ol.renderer.Layer.prototype.manageTilePyramid =
|
ol.renderer.Layer.prototype.manageTilePyramid = function(frameState, tileSource,
|
||||||
function(frameState, tileSource, tileGrid, projection, extent, currentZ) {
|
tileGrid, projection, extent, currentZ, opt_tileCallback, opt_obj) {
|
||||||
var tileSourceKey = goog.getUid(tileSource).toString();
|
var tileSourceKey = goog.getUid(tileSource).toString();
|
||||||
if (!(tileSourceKey in frameState.wantedTiles)) {
|
if (!(tileSourceKey in frameState.wantedTiles)) {
|
||||||
frameState.wantedTiles[tileSourceKey] = {};
|
frameState.wantedTiles[tileSourceKey] = {};
|
||||||
@@ -323,6 +326,9 @@ ol.renderer.Layer.prototype.manageTilePyramid =
|
|||||||
tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]);
|
tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (goog.isDef(opt_tileCallback)) {
|
||||||
|
opt_tileCallback.call(opt_obj, tile);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tileSource.useTile(z, x, y);
|
tileSource.useTile(z, x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user