src/geometry/ext/Geometry.Animation.js
function (styles, options, step) {
        if (this._animPlayer) {
            this._animPlayer.finish();
        }
        if (isFunction(options)) {
            step = options;
        }
        if (!options) {
            options = {};
        }
        const map = this.getMap(),
            projection = this._getProjection(),
            symbol = this.getSymbol() || {},
            stylesToAnimate = this._prepareAnimationStyles(styles);
        let preTranslate;

        const isFocusing = options['focus'];
        delete this._animationStarted;
        // geometry.animate can be called without map
        if (map) {
            // merge geometry animation framing into map's frame loop
            const renderer = map._getRenderer();
            const framer = function (fn) {
                renderer.callInNextFrame(fn);
            };
            options['framer'] = framer;
        }

        const player = Animation.animate(stylesToAnimate, options, frame => {
            if (map && map.isRemoved()) {
                player.finish();
                return;
            }
            if (map && !this._animationStarted && isFocusing) {
                map.onMoveStart();
            }
            const styles = frame.styles;
            for (const p in styles) {
                if (p !== 'symbol' && p !== 'translate' && styles.hasOwnProperty(p)) {
                    const fnName = 'set' + p[0].toUpperCase() + p.slice(1);
                    this[fnName](styles[p]);
                }
            }
            const translate = styles['translate'];
            if (translate) {
                let toTranslate = translate;
                if (preTranslate) {
                    toTranslate = translate.sub(preTranslate);
                }
                preTranslate = translate;
                this.translate(toTranslate);
            }
            const dSymbol = styles['symbol'];
            if (dSymbol) {
                this.setSymbol(extendSymbol(symbol, dSymbol));
            }
            if (map && isFocusing) {
                const pcenter = projection.project(this.getCenter());
                map._setPrjCenter(pcenter);
                const e = map._parseEventFromCoord(projection.unproject(pcenter));
                if (player.playState !== 'running') {
                    map.onMoveEnd(e);
                } else {
                    map.onMoving(e);
                }
            }
            this._fireAnimateEvent(player.playState);
            if (step) {
                step(frame);
            }
        });
        this._animPlayer = player;
        return this._animPlayer.play();
    }
function (styles, options, step) {
        if (this._animPlayer) {
            this._animPlayer.finish();
        }
        if (isFunction(options)) {
            step = options;
        }
        if (!options) {
            options = {};
        }
        const map = this.getMap(),
            projection = this._getProjection(),
            symbol = this.getSymbol() || {},
            stylesToAnimate = this._prepareAnimationStyles(styles);
        let preTranslate;

        const isFocusing = options['focus'];
        delete this._animationStarted;
        // geometry.animate can be called without map
        if (map) {
            // merge geometry animation framing into map's frame loop
            const renderer = map._getRenderer();
            const framer = function (fn) {
                renderer.callInNextFrame(fn);
            };
            options['framer'] = framer;
        }

        const player = Animation.animate(stylesToAnimate, options, frame => {
            if (map && map.isRemoved()) {
                player.finish();
                return;
            }
            if (map && !this._animationStarted && isFocusing) {
                map.onMoveStart();
            }
            const styles = frame.styles;
            for (const p in styles) {
                if (p !== 'symbol' && p !== 'translate' && styles.hasOwnProperty(p)) {
                    const fnName = 'set' + p[0].toUpperCase() + p.slice(1);
                    this[fnName](styles[p]);
                }
            }
            const translate = styles['translate'];
            if (translate) {
                let toTranslate = translate;
                if (preTranslate) {
                    toTranslate = translate.sub(preTranslate);
                }
                preTranslate = translate;
                this.translate(toTranslate);
            }
            const dSymbol = styles['symbol'];
            if (dSymbol) {
                this.setSymbol(extendSymbol(symbol, dSymbol));
            }
            if (map && isFocusing) {
                const pcenter = projection.project(this.getCenter());
                map._setPrjCenter(pcenter);
                const e = map._parseEventFromCoord(projection.unproject(pcenter));
                if (player.playState !== 'running') {
                    map.onMoveEnd(e);
                } else {
                    map.onMoving(e);
                }
            }
            this._fireAnimateEvent(player.playState);
            if (step) {
                step(frame);
            }
        });
        this._animPlayer = player;
        return this._animPlayer.play();
    }
function ( styles , options , step ) { if ( this . _animPlayer ) { this . _animPlayer . finish ( ) ; } if ( isFunction ( options ) ) { step = options ; } if ( ! options ) { options = { } ; } const map = this . getMap ( ) , projection = this . _getProjection ( ) , symbol = this . getSymbol ( ) || { } , stylesToAnimate = this . _prepareAnimationStyles ( styles ) ; let preTranslate ; const isFocusing = options [ 'focus' ] ; delete this . _animationStarted ; // geometry.animate can be called without map if ( map ) { // merge geometry animation framing into map's frame loop const renderer = map . _getRenderer ( ) ; const framer = function ( fn ) { renderer . callInNextFrame ( fn ) ; } ; options [ 'framer' ] = framer ; } const player = Animation . animate ( stylesToAnimate , options , frame => { if ( map && map . isRemoved ( ) ) { player . finish ( ) ; return ; } if ( map && ! this . _animationStarted && isFocusing ) { map . onMoveStart ( ) ; } const styles = frame . styles ; for ( const p in styles ) { if ( p !== 'symbol' && p !== 'translate' && styles . hasOwnProperty ( p ) ) { const fnName = 'set' + p [ 0 ] . toUpperCase ( ) + p . slice ( 1 ) ; this [ fnName ] ( styles [ p ] ) ; } } const translate = styles [ 'translate' ] ; if ( translate ) { let toTranslate = translate ; if ( preTranslate ) { toTranslate = translate . sub ( preTranslate ) ; } preTranslate = translate ; this . translate ( toTranslate ) ; } const dSymbol = styles [ 'symbol' ] ; if ( dSymbol ) { this . setSymbol ( extendSymbol ( symbol , dSymbol ) ) ; } if ( map && isFocusing ) { const pcenter = projection . project ( this . getCenter ( ) ) ; map . _setPrjCenter ( pcenter ) ; const e = map . _parseEventFromCoord ( projection . unproject ( pcenter ) ) ; if ( player . playState !== 'running' ) { map . onMoveEnd ( e ) ; } else { map . onMoving ( e ) ; } } this . _fireAnimateEvent ( player . playState ) ; if ( step ) { step ( frame ) ; } } ) ; this . _animPlayer = player ; return this . _animPlayer . play ( ) ; }
Animate the geometry

@param  {Object}   styles          - styles to animate
@param  {Object}   [options=null]  - animation options
@param  {NUmber}   [options.duration=1000]      - duration
@param  {Number}   [options.startTime=null]  - time to start animation in ms
@param  {String}   [options.easing=linear]   - animation easing: in, out, inAndOut, linear, upAndDown
@param  {Boolean}  [options.repeat=false]      - repeat animation
@param  {Function} [step=null]  - step function during animation, animation frame as the parameter
@return {animation.Player} animation player
@example
var player = marker.animate({
'symbol': {
'markerHeight': 82
}
}, {
'duration': 2000
}, function (frame) {
if (frame.state.playState === 'finished') {
console.log('animation finished');
}
});
player.pause();
Animate the geometry