diff --git a/src/ol/Kinetic.js b/src/ol/Kinetic.js index 449c522b20..500d10c234 100644 --- a/src/ol/Kinetic.js +++ b/src/ol/Kinetic.js @@ -1,6 +1,7 @@ /** * @module ol/Kinetic */ + /** * @classdesc * Implementation of inertial deceleration for map movement. @@ -13,7 +14,7 @@ * @struct * @api */ -var _ol_Kinetic_ = function(decay, minVelocity, delay) { +var Kinetic = function(decay, minVelocity, delay) { /** * @private @@ -56,7 +57,7 @@ var _ol_Kinetic_ = function(decay, minVelocity, delay) { /** * FIXME empty description for jsdoc */ -_ol_Kinetic_.prototype.begin = function() { +Kinetic.prototype.begin = function() { this.points_.length = 0; this.angle_ = 0; this.initialVelocity_ = 0; @@ -67,7 +68,7 @@ _ol_Kinetic_.prototype.begin = function() { * @param {number} x X. * @param {number} y Y. */ -_ol_Kinetic_.prototype.update = function(x, y) { +Kinetic.prototype.update = function(x, y) { this.points_.push(x, y, Date.now()); }; @@ -75,7 +76,7 @@ _ol_Kinetic_.prototype.update = function(x, y) { /** * @return {boolean} Whether we should do kinetic animation. */ -_ol_Kinetic_.prototype.end = function() { +Kinetic.prototype.end = function() { if (this.points_.length < 6) { // at least 2 points are required (i.e. there must be at least 6 elements // in the array) @@ -114,7 +115,7 @@ _ol_Kinetic_.prototype.end = function() { /** * @return {number} Total distance travelled (pixels). */ -_ol_Kinetic_.prototype.getDistance = function() { +Kinetic.prototype.getDistance = function() { return (this.minVelocity_ - this.initialVelocity_) / this.decay_; }; @@ -122,7 +123,7 @@ _ol_Kinetic_.prototype.getDistance = function() { /** * @return {number} Angle of the kinetic panning animation (radians). */ -_ol_Kinetic_.prototype.getAngle = function() { +Kinetic.prototype.getAngle = function() { return this.angle_; }; -export default _ol_Kinetic_; +export default Kinetic; diff --git a/src/ol/interaction.js b/src/ol/interaction.js index d6d12730cf..5cfe6956b3 100644 --- a/src/ol/interaction.js +++ b/src/ol/interaction.js @@ -2,7 +2,7 @@ * @module ol/interaction */ import _ol_Collection_ from './Collection.js'; -import _ol_Kinetic_ from './Kinetic.js'; +import Kinetic from './Kinetic.js'; import DoubleClickZoom from './interaction/DoubleClickZoom.js'; import DragPan from './interaction/DragPan.js'; import DragRotate from './interaction/DragRotate.js'; @@ -44,7 +44,7 @@ _ol_interaction_.defaults = function(opt_options) { var interactions = new _ol_Collection_(); - var kinetic = new _ol_Kinetic_(-0.005, 0.05, 100); + var kinetic = new Kinetic(-0.005, 0.05, 100); var altShiftDragRotate = options.altShiftDragRotate !== undefined ? options.altShiftDragRotate : true;