Skip to content

Commit

Permalink
Animate double click/tap zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
elemoine authored and tschaub committed Mar 6, 2013
1 parent 066a81a commit 5644c27
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ol/interaction/dblclickzoominteraction.js
Expand Up @@ -8,6 +8,12 @@ goog.require('ol.View2D');
goog.require('ol.interaction.Interaction');


/**
* @define {number} Animation duration.
*/
ol.interaction.DBLCLICKZOOM_ANIMATION_DURATION = 250;



/**
* @constructor
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 5644c27

Please sign in to comment.