Animate zoom after pinch
This commit is contained in:
@@ -8,6 +8,12 @@ goog.require('ol.ViewHint');
|
|||||||
goog.require('ol.interaction.Touch');
|
goog.require('ol.interaction.Touch');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @define {number} Animation duration.
|
||||||
|
*/
|
||||||
|
ol.interaction.TOUCHZOOM_ANIMATION_DURATION = 250;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
@@ -73,7 +79,8 @@ ol.interaction.TouchZoom.prototype.handleTouchEnd =
|
|||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
// take the resolution constraint into account
|
// 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);
|
view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user