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 1
If interval = 0.2, a trajectory will be divided into 5 segments, if interval = 0.5, it will be two segments.