Add new ol.easing.elastic and ol.easing.bounce easing functions.

This commit is contained in:
Frederic Junod
2013-01-17 17:03:53 +01:00
parent 202df34e71
commit 8825251c42
2 changed files with 41 additions and 2 deletions

View File

@@ -113,7 +113,8 @@ keyboardInteraction.addCallback('j', function() {
canvasMap.addPreRenderFunction(bounce);
});
keyboardInteraction.addCallback('l', function() {
var panFrom = ol.animation.createPanFrom(view.getCenter());
var panFrom = ol.animation.createPanFrom(
view.getCenter(), undefined, undefined, ol.easing.elastic);
domMap.addPreRenderFunction(panFrom);
webglMap.addPreRenderFunction(panFrom);
canvasMap.addPreRenderFunction(panFrom);
@@ -133,7 +134,8 @@ keyboardInteraction.addCallback('L', function() {
view.setCenter(LONDON);
});
keyboardInteraction.addCallback('m', function() {
var panFrom = ol.animation.createPanFrom(view.getCenter(), 1000);
var panFrom = ol.animation.createPanFrom(
view.getCenter(), 1000, undefined, ol.easing.bounce);
domMap.addPreRenderFunction(panFrom);
webglMap.addPreRenderFunction(panFrom);
canvasMap.addPreRenderFunction(panFrom);