Remove use of goog.partial

Use Function.prototype.bind instead, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Partially_applied_functions_(currying)
This commit is contained in:
Frederic Junod
2016-05-02 14:49:25 +02:00
parent 9f3c951c71
commit 7c15280e81
5 changed files with 42 additions and 40 deletions
+13 -11
View File
@@ -181,18 +181,20 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() {
*/
ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) {
if (tileSource.canExpireCache()) {
/**
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map.
* @param {olx.FrameState} frameState Frame state.
*/
var postRenderFunction = function(tileSource, map, frameState) {
var tileSourceKey = goog.getUid(tileSource).toString();
tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]);
}.bind(null, tileSource);
frameState.postRenderFunctions.push(
/** @type {ol.PostRenderFunction} */ (goog.partial(
/**
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map.
* @param {olx.FrameState} frameState Frame state.
*/
function(tileSource, map, frameState) {
var tileSourceKey = goog.getUid(tileSource).toString();
tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]);
}, tileSource)));
/** @type {ol.PostRenderFunction} */ (postRenderFunction)
);
}
};