Kinetic now returns directly the pre-render function

instead of returning the kinetic easing function only.

(thanks @fredj)
This commit is contained in:
Bruno Binet
2013-01-29 14:50:12 +01:00
parent 2bb8a5cfd9
commit 79849888db
2 changed files with 11 additions and 9 deletions

View File

@@ -7,7 +7,6 @@ goog.require('ol.Coordinate');
goog.require('ol.MapBrowserEvent');
goog.require('ol.View2D');
goog.require('ol.ViewHint');
goog.require('ol.animation');
goog.require('ol.interaction.ConditionType');
goog.require('ol.interaction.Drag');
@@ -83,11 +82,7 @@ ol.interaction.DragPan.prototype.handleDragEnd = function(mapBrowserEvent) {
var distance = this.kinetic_.getDistance();
var angle = this.kinetic_.getAngle();
var center = view.getCenter();
this.kineticPreRenderFn_ = ol.animation.createPanFrom({
source: center,
duration: this.kinetic_.getDuration(),
easing: this.kinetic_.getEasingFn()
});
this.kineticPreRenderFn_ = this.kinetic_.createPanFrom(center);
map.addPreRenderFunction(this.kineticPreRenderFn_);
var centerpx = map.getPixelFromCoordinate(center);