ol. ol.animation

The {ol.animation} static methods are designed to be used with the ol.Map#beforeRender method. For example:

var map = new ol.Map({ ... });
var zoom = ol.animation.zoom({
  resolution: map.getView().getResolution()
});
map.beforeRender(zoom);
map.getView().setResolution(map.getView().getResolution() * 2);
Source:
  • animation.jsdoc, line 1

Methods

<static> bounce

Stability: experimental
Parameters:
Name Type Description
options olx.animation.BounceOptions

Bounce options.

Properties
Name Type Description
resolution number

The resolution to start the bounce from, typically map.getView().getResolution().

start number | undefined

The start time of the animation. Default is immediately.

duration number | undefined

The duration of the animation in milliseconds. Default is 1000.

easing function

The easing function to use. Default is ol.easing.upAndDown

Source:
  • animation.js, line 16
Returns:

Pre-render function.

Type
ol.PreRenderFunction

<static> pan

Stability: experimental
Parameters:
Name Type Description
options olx.animation.PanOptions

Pan options.

Properties
Name Type Description
source ol.Coordinate

The location to start panning from, typically map.getView().getCenter().

start number | undefined

The start time of the animation. Default is immediately.

duration number | undefined

The duration of the animation in milliseconds. Default is 1000.

easing function

The easing function to use. Default is ol.easing.inAndOut

Source:
  • animation.js, line 51
Returns:

Pre-render function.

Type
ol.PreRenderFunction

<static> rotate

Stability: experimental
Parameters:
Name Type Description
options olx.animation.RotateOptions

Rotate options.

Properties
Name Type Description
rotation number | undefined

The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed.

anchor ol.Coordinate | undefined

The rotation center/anchor. The map rotates around the center of the view if unspecified.

start number | undefined

The start time of the animation. Default is immediately.

duration number | undefined

The duration of the animation in milliseconds. Default is 1000.

easing function

The easing function to use. Default is ol.easing.inAndOut

Source:
  • animation.js, line 90
Returns:

Pre-render function.

Type
ol.PreRenderFunction

<static> zoom

Stability: experimental
Parameters:
Name Type Description
options olx.animation.ZoomOptions

Zoom options.

Properties
Name Type Description
resolution number

number The resolution to begin zooming from, typically map.getView().getResolution().

start number | undefined

The start time of the animation. Default is immediately.

duration number | undefined

The duration of the animation in milliseconds. Default is 1000.

easing function

Easing function.

Source:
  • animation.js, line 135
Returns:

Pre-render function.

Type
ol.PreRenderFunction