Animate double click/tap zoom
This commit is contained in:
@@ -8,6 +8,12 @@ goog.require('ol.View2D');
|
|||||||
goog.require('ol.interaction.Interaction');
|
goog.require('ol.interaction.Interaction');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @define {number} Animation duration.
|
||||||
|
*/
|
||||||
|
ol.interaction.DBLCLICKZOOM_ANIMATION_DURATION = 250;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -41,7 +47,8 @@ ol.interaction.DblClickZoom.prototype.handleMapBrowserEvent =
|
|||||||
// FIXME works for View2D only
|
// FIXME works for View2D only
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
goog.asserts.assert(view instanceof ol.View2D);
|
goog.asserts.assert(view instanceof ol.View2D);
|
||||||
view.zoomByDelta(map, delta, anchor);
|
view.zoomByDelta(map, delta, anchor,
|
||||||
|
ol.interaction.DBLCLICKZOOM_ANIMATION_DURATION);
|
||||||
mapBrowserEvent.preventDefault();
|
mapBrowserEvent.preventDefault();
|
||||||
browserEvent.preventDefault();
|
browserEvent.preventDefault();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user