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
-
Parameters:
Name Type Description optionsol.animation.BounceOptions Bounce options.
- Source:
- animation.js, line 14
Returns:
Pre-render function.
- Type
- ol.PreRenderFunction
-
<static> pan
-
Parameters:
Name Type Description optionsol.animation.PanOptions Pan options.
- Source:
- animation.js, line 48
Returns:
Pre-render function.
- Type
- ol.PreRenderFunction
-
<static> rotate
-
Parameters:
Name Type Description optionsol.animation.RotateOptions Rotate options.
- Source:
- animation.js, line 86
Returns:
Pre-render function.
- Type
- ol.PreRenderFunction
-
<static> zoom
-
Parameters:
Name Type Description optionsol.animation.ZoomOptions Zoom options.
- Source:
- animation.js, line 122
Returns:
Pre-render function.
- Type
- ol.PreRenderFunction
TypeDefs
-
BounceOptions
-
- Source:
- objectliterals.jsdoc, line 21
Properties:
Name Type Description resolutionnumber The resolution to start the bounce from, typically
map.getView().getResolution().startnumber | undefined The start time of the animation. Default is immediately.
durationnumber | undefined The duration of the animation in milliseconds. Default is 1000.
easingfunction The easing function to use. Default is
ol.easing.upAndDown -
PanOptions
-
- Source:
- objectliterals.jsdoc, line 23
Properties:
Name Type Description sourceol.Coordinate The location to start panning from, typically
map.getView().getCenter().startnumber | undefined The start time of the animation. Default is immediately.
durationnumber | undefined The duration of the animation in milliseconds. Default is 1000.
easingfunction The easing function to use. Default is
ol.easing.inAndOut -
RotateOptions
-
- Source:
- objectliterals.jsdoc, line 25
Properties:
Name Type Description rotationnumber The rotation to apply, in radians.
startnumber | undefined The start time of the animation. Default is immediately.
durationnumber | undefined The duration of the animation in milliseconds. Default is 1000.
easingfunction The easing function to use. Default is
ol.easing.inAndOut -
ZoomOptions
-
- Source:
- objectliterals.jsdoc, line 27
Properties:
Name Type Description resolutionnumber number The resolution to begin zooming from, typically
map.getView().getResolution().startnumber | undefined The start time of the animation. Default is immediately.
durationnumber | undefined The duration of the animation in milliseconds.
easingfunction Easing function.