Use option object rather than positional arguments for ol.animation.create* functions

This commit is contained in:
Frederic Junod
2013-01-23 14:35:14 +01:00
parent 6d3e0778e1
commit 7568688301
4 changed files with 113 additions and 65 deletions
+4 -2
View File
@@ -296,8 +296,10 @@ ol.View2D.prototype.zoom = function(map, delta, opt_anchor, opt_duration) {
var currentResolution = this.getResolution();
if (goog.isDef(currentResolution) && goog.isDef(opt_duration)) {
map.requestRenderFrame();
map.addPreRenderFunction(ol.animation.createZoomFrom(
currentResolution, opt_duration));
map.addPreRenderFunction(ol.animation.createZoomFrom({
resolution: currentResolution,
duration: opt_duration
}));
}
var resolution = this.constraints_.resolution(currentResolution, delta);
this.zoom_(map, resolution, opt_anchor);