Skip to main content

LinearInterpolator

Performs simple linear interpolation between two view states. Implements TransitionInterpolator.

See View State Transitions for usage examples.

Constructor

import {LinearInterpolator} from '@deck.gl/core';

new LinearInterpolator({transitionProps: ['target', 'zoom']});

Parameters:

  • options (object)
    • transitionProps (string[], optional) - Array of prop names that should be linearly interpolated. Default ['longitude', 'latitude', 'zoom', 'bearing', 'pitch'].
    • around (number[2], optional) - A point to zoom/rotate around, [x, y] in screen pixels. If provided, the location at this point will not move during the transition.
    • makeViewport (Function, optional) - Called to construct a viewport, e.g. props => new WebMercatorViewport(props). Must be provided if around is used.

Source

modules/core/src/transitions/linear-interpolator.ts