Rename addPreRenderFunction to beforeRender and remove the plural

This commit is contained in:
Tim Schaub
2013-09-03 10:57:31 -06:00
parent e83e0e1374
commit dc76b81780
9 changed files with 25 additions and 39 deletions

View File

@@ -388,27 +388,14 @@ ol.Map.prototype.addOverlay = function(overlay) {
/**
* Add a prerender function. This can be used for attaching animations to
* be performed before setting the map's center. The {@link ol.animation}
* Add functions to be called before rendering. This can be used for attaching
* animations before updating the map's view. The {@link ol.animation}
* namespace provides several static methods for creating prerender functions.
* @param {ol.PreRenderFunction} preRenderFunction Pre-render function.
* @param {...ol.PreRenderFunction} var_args Any number of pre-render functions.
*/
ol.Map.prototype.addPreRenderFunction = function(preRenderFunction) {
ol.Map.prototype.beforeRender = function(var_args) {
this.requestRenderFrame();
this.preRenderFunctions_.push(preRenderFunction);
};
/**
* Add prerender functions. This can be used for attaching animations to
* be performed before setting the map's center. See {@link ol.animation}
* @param {Array.<ol.PreRenderFunction>} preRenderFunctions
* Pre-render functions.
*/
ol.Map.prototype.addPreRenderFunctions = function(preRenderFunctions) {
this.requestRenderFrame();
Array.prototype.push.apply(
this.preRenderFunctions_, preRenderFunctions);
Array.prototype.push.apply(this.preRenderFunctions_, arguments);
};