Moving animation methods out of Util.js.
Animation methods get their own module, giving methods more sensible names: * `OpenLayers.Animation.requestFrame` (was `OpenLayers.Util.requestAnimationFrame`) * `OpenLayers.Animation.start` (was `OpenLayers.Util.startAnimation`) * `OpenLayers.Animation.stop` (was `OpenLayers.Util.stopAnimation`)
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for
|
||||
* full list of contributors). Published under the Clear BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||
* full text of the license. */
|
||||
* full text of the license.
|
||||
*
|
||||
* @requires OpenLayers/BaseTypes/Class.js
|
||||
* @requires OpenLayers/Animation.js
|
||||
*/
|
||||
|
||||
OpenLayers.Kinetic = OpenLayers.Class({
|
||||
|
||||
@@ -59,7 +63,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
|
||||
* Begins the dragging.
|
||||
*/
|
||||
begin: function() {
|
||||
OpenLayers.Util.stopAnimation(this.timerId);
|
||||
OpenLayers.Animation.stop(this.timerId);
|
||||
this.timerId = undefined;
|
||||
this.points = [];
|
||||
},
|
||||
@@ -152,7 +156,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
|
||||
var v = -this.deceleration * t + v0;
|
||||
|
||||
if (v <= 0) {
|
||||
OpenLayers.Util.stopAnimation(this.timerId);
|
||||
OpenLayers.Animation.stop(this.timerId);
|
||||
this.timerId = null;
|
||||
args.end = true;
|
||||
}
|
||||
@@ -164,7 +168,7 @@ OpenLayers.Kinetic = OpenLayers.Class({
|
||||
callback(args.x, args.y, args.end);
|
||||
};
|
||||
|
||||
this.timerId = OpenLayers.Util.startAnimation(
|
||||
this.timerId = OpenLayers.Animation.start(
|
||||
OpenLayers.Function.bind(timerCallback, this)
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user