From e598e4b9b246fed403424548b0d07da8d3b899f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 4 Mar 2013 20:59:33 +0100 Subject: [PATCH] Animate zoom after pinch --- src/ol/interaction/touchzoominteraction.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ol/interaction/touchzoominteraction.js b/src/ol/interaction/touchzoominteraction.js index ed14b714cf..76d99bafd7 100644 --- a/src/ol/interaction/touchzoominteraction.js +++ b/src/ol/interaction/touchzoominteraction.js @@ -8,6 +8,12 @@ goog.require('ol.ViewHint'); goog.require('ol.interaction.Touch'); +/** + * @define {number} Animation duration. + */ +ol.interaction.TOUCHZOOM_ANIMATION_DURATION = 250; + + /** * @constructor @@ -73,7 +79,8 @@ ol.interaction.TouchZoom.prototype.handleTouchEnd = var map = mapBrowserEvent.map; var view = map.getView(); // take the resolution constraint into account - view.zoom(map, view.getResolution()); + view.zoom(map, view.getResolution(), undefined, + ol.interaction.TOUCHZOOM_ANIMATION_DURATION); view.setHint(ol.ViewHint.INTERACTING, -1); return false; } else {