Remove goog.net.* and goog.async.AnimationDelay

This commit is contained in:
Andreas Hocevar
2016-01-27 23:15:17 +01:00
parent 2b451e7893
commit f35d0106b8
10 changed files with 123 additions and 113 deletions

View File

@@ -6,7 +6,6 @@ goog.provide('ol.Map');
goog.provide('ol.MapProperty');
goog.require('goog.asserts');
goog.require('goog.async.AnimationDelay');
goog.require('goog.async.nextTick');
goog.require('goog.debug.Console');
goog.require('goog.dom');
@@ -199,11 +198,17 @@ ol.Map = function(options) {
/**
* @private
* @type {goog.async.AnimationDelay}
* @type {number|undefined}
*/
this.animationDelay_ =
new goog.async.AnimationDelay(this.renderFrame_, undefined, this);
this.registerDisposable(this.animationDelay_);
this.animationDelayKey_;
/**
* @private
*/
this.animationDelay_ = function() {
this.animationDelayKey_ = undefined;
this.renderFrame_.call(this, Date.now());
}.bind(this);
/**
* @private
@@ -1200,7 +1205,10 @@ ol.Map.prototype.isRendered = function() {
* @api stable
*/
ol.Map.prototype.renderSync = function() {
this.animationDelay_.fire();
if (this.animationDelayKey_) {
goog.global.cancelAnimationFrame(this.animationDelayKey_);
}
this.animationDelay_();
};
@@ -1209,8 +1217,9 @@ ol.Map.prototype.renderSync = function() {
* @api stable
*/
ol.Map.prototype.render = function() {
if (!this.animationDelay_.isActive()) {
this.animationDelay_.start();
if (this.animationDelayKey_ === undefined) {
this.animationDelayKey_ = goog.global.requestAnimationFrame(
this.animationDelay_);
}
};