Skip to content

Animate

The line layer is onanimateAfter the method, you will get the line animation along the line direction.

案例

animate(boolean | IAnimateOption)

animateThe method supports Boolean and object passing values.

layer.animate(true);

layer.animate({
  enable: true,
});

IAnimateOption

interface IAnimateOption {
  enable: boolean;
  speed: number;
  rings: number;
}

animate

Turn on and off animation

layer.animate(true);
layer.animate(false);

Set animation parameters

  • duration animation time unit (s) seconds
  • interval trajectory interval, value range 0 - 1
  • trailLength trail length value range 0 - 1
layer.animate({
  duration: 4,
  interval: 0.2,
  trailLength: 0.1,
});
Introduction to parameter animation

L7 The current animation parameters are relative units, and our default length of a line segment is 1L7 动画参数

If interval = 0.2, a trajectory will be divided into 5 segments, if interval = 0.5, it will be two segments.

案例

Online case

© Copyright 2026 Ant Group Co., Ltd..备案号:京ICP备15032932号-38
Site search
Documentation and examplesType to start searching

Search documentation, APIs, and examples

↑↓Select↵OpenEscClose