Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Animate double click/tap zoom

  • Loading branch information...
commit 5644c27d9e4043fc10980d712379da80ca3e6f0e 1 parent 066a81a
@elemoine elemoine authored tschaub committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/ol/interaction/dblclickzoominteraction.js
View
9 src/ol/interaction/dblclickzoominteraction.js
@@ -8,6 +8,12 @@ goog.require('ol.View2D');
goog.require('ol.interaction.Interaction');
+/**
+ * @define {number} Animation duration.
+ */
+ol.interaction.DBLCLICKZOOM_ANIMATION_DURATION = 250;
+
+
/**
* @constructor
@@ -41,7 +47,8 @@ ol.interaction.DblClickZoom.prototype.handleMapBrowserEvent =
// FIXME works for View2D only
var view = map.getView();
goog.asserts.assert(view instanceof ol.View2D);
- view.zoomByDelta(map, delta, anchor);
+ view.zoomByDelta(map, delta, anchor,
+ ol.interaction.DBLCLICKZOOM_ANIMATION_DURATION);
mapBrowserEvent.preventDefault();
browserEvent.preventDefault();
}
Please sign in to comment.
Something went wrong with that request. Please try again.