Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Animate zoom after pinch

  • Loading branch information...
commit 066a81a88a787507b7f0829cd7da196b8bf81707 1 parent a4c47ed
@elemoine elemoine authored tschaub committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/ol/interaction/touchzoominteraction.js
View
9 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 {
Please sign in to comment.
Something went wrong with that request. Please try again.