From 2ed3f28ab83687bcafd358088c03c85195dec5f6 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Mon, 28 Sep 2015 15:23:36 +0200 Subject: [PATCH] Use Date.now() instead of goog.now() --- src/ol/animation.js | 8 ++++---- src/ol/interaction/mousewheelzoominteraction.js | 4 ++-- src/ol/kinetic.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ol/animation.js b/src/ol/animation.js index 6358452621..84acd4a2d8 100644 --- a/src/ol/animation.js +++ b/src/ol/animation.js @@ -16,7 +16,7 @@ goog.require('ol.easing'); */ ol.animation.bounce = function(options) { var resolution = options.resolution; - var start = options.start ? options.start : goog.now(); + var start = options.start ? options.start : Date.now(); var duration = options.duration !== undefined ? options.duration : 1000; var easing = options.easing ? options.easing : ol.easing.upAndDown; @@ -52,7 +52,7 @@ ol.animation.bounce = function(options) { */ ol.animation.pan = function(options) { var source = options.source; - var start = options.start ? options.start : goog.now(); + var start = options.start ? options.start : Date.now(); var sourceX = source[0]; var sourceY = source[1]; var duration = options.duration !== undefined ? options.duration : 1000; @@ -92,7 +92,7 @@ ol.animation.pan = function(options) { */ ol.animation.rotate = function(options) { var sourceRotation = options.rotation ? options.rotation : 0; - var start = options.start ? options.start : goog.now(); + var start = options.start ? options.start : Date.now(); var duration = options.duration !== undefined ? options.duration : 1000; var easing = options.easing ? options.easing : ol.easing.inAndOut; @@ -138,7 +138,7 @@ ol.animation.rotate = function(options) { */ ol.animation.zoom = function(options) { var sourceResolution = options.resolution; - var start = options.start ? options.start : goog.now(); + var start = options.start ? options.start : Date.now(); var duration = options.duration !== undefined ? options.duration : 1000; var easing = options.easing ? options.easing : ol.easing.inAndOut; diff --git a/src/ol/interaction/mousewheelzoominteraction.js b/src/ol/interaction/mousewheelzoominteraction.js index 6d55735bf8..d906967b21 100644 --- a/src/ol/interaction/mousewheelzoominteraction.js +++ b/src/ol/interaction/mousewheelzoominteraction.js @@ -91,11 +91,11 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) { this.delta_ += mouseWheelEvent.deltaY; if (this.startTime_ === undefined) { - this.startTime_ = goog.now(); + this.startTime_ = Date.now(); } var duration = ol.MOUSEWHEELZOOM_TIMEOUT_DURATION; - var timeLeft = Math.max(duration - (goog.now() - this.startTime_), 0); + var timeLeft = Math.max(duration - (Date.now() - this.startTime_), 0); goog.global.clearTimeout(this.timeoutId_); this.timeoutId_ = goog.global.setTimeout( diff --git a/src/ol/kinetic.js b/src/ol/kinetic.js index c4cf3b99c2..492f1df049 100644 --- a/src/ol/kinetic.js +++ b/src/ol/kinetic.js @@ -73,7 +73,7 @@ ol.Kinetic.prototype.begin = function() { * @param {number} y Y. */ ol.Kinetic.prototype.update = function(x, y) { - this.points_.push(x, y, goog.now()); + this.points_.push(x, y, Date.now()); }; @@ -86,7 +86,7 @@ ol.Kinetic.prototype.end = function() { // in the array) return false; } - var delay = goog.now() - this.delay_; + var delay = Date.now() - this.delay_; var lastIndex = this.points_.length - 3; if (this.points_[lastIndex + 2] < delay) { // the last tracked point is too old, which means that the user stopped