# Namespace: animation

## 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);

### Methods

#### staticol.animation.bounce(options){ol.PreRenderFunction} experimental

src/ol/animation.js, line 16

  Name | Type | Description
  --- | --- | ---
  `options` | Bounce options.
  Name | Type | Description
  --- | --- | ---
  `resolution` | number | The resolution to start the bounce from, typically `map.getView().getResolution()`.
  `start` | number | undefined | optional The start time of the animation. Default is immediately.
  `duration` | number | undefined | optional The duration of the animation in milliseconds. Default is `1000`.
  `easing` | function | The easing function to use. Default is `ol.easing.upAndDown`

  ##### Returns:

  Pre-render function.

#### staticol.animation.pan(options){ol.PreRenderFunction} experimental

src/ol/animation.js, line 51

  Name | Type | Description
  --- | --- | ---
  `options` | Pan options.
  Name | Type | Description
  --- | --- | ---
  `source` | ol.Coordinate | The location to start panning from, typically `map.getView().getCenter()`.
  `start` | number | undefined | optional The start time of the animation. Default is immediately.
  `duration` | number | undefined | optional The duration of the animation in milliseconds. Default is `1000`.
  `easing` | function | The easing function to use. Default is `ol.easing.inAndOut`

  ##### Returns:

  Pre-render function.

#### staticol.animation.rotate(options){ol.PreRenderFunction} experimental

src/ol/animation.js, line 90

  Name | Type | Description
  --- | --- | ---
  `options` | Rotate options.
  Name | Type | Description
  --- | --- | ---
  `rotation` | number | undefined | optional The rotation value (in radians) to begin rotating from, typically `map.getView().getRotation()`. If `undefined` then `0` is assumed.
  `anchor` | ol.Coordinate | undefined | optional The rotation center/anchor. The map rotates around the center of the view if unspecified.
  `start` | number | undefined | optional The start time of the animation. Default is immediately.
  `duration` | number | undefined | optional The duration of the animation in milliseconds. Default is `1000`.
  `easing` | function | The easing function to use. Default is `ol.easing.inAndOut`

  ##### Returns:

  Pre-render function.

#### staticol.animation.zoom(options){ol.PreRenderFunction} experimental

src/ol/animation.js, line 135

  Name | Type | Description
  --- | --- | ---
  `options` | Zoom options.
  Name | Type | Description
  --- | --- | ---
  `resolution` | number | number The resolution to begin zooming from, typically `map.getView().getResolution()`.
  `start` | number | undefined | optional The start time of the animation. Default is immediately.
  `duration` | number | undefined | optional The duration of the animation in milliseconds. Default is `1000`.
  `easing` | function | Easing function.

  ##### Returns:

  Pre-render function.