Move pan function from View2D to Interaction

This commit is contained in:
Éric Lemoine
2013-04-09 17:56:48 +02:00
parent 396ee5ce3d
commit 51094139a8
3 changed files with 27 additions and 22 deletions
-21
View File
@@ -376,27 +376,6 @@ goog.exportProperty(
ol.View2D.prototype.setRotation);
/**
* @param {ol.Map} map Map.
* @param {ol.Coordinate} delta Delta.
* @param {number=} opt_duration Duration.
*/
ol.View2D.prototype.pan = function(map, delta, opt_duration) {
var currentCenter = this.getCenter();
if (goog.isDef(currentCenter)) {
if (goog.isDef(opt_duration)) {
map.requestRenderFrame();
map.addPreRenderFunction(ol.animation.pan({
source: currentCenter,
duration: opt_duration,
easing: ol.easing.linear
}));
}
this.setCenter([currentCenter[0] + delta[0], currentCenter[1] + delta[1]]);
}
};
/**
* @param {ol.Map} map Map.
* @param {number|undefined} rotation Rotation.