目录

Class (ScaleAnimation)

Modules to Import

import { map } from '@kit.MapKit';

ScaleAnimation

Animation class for controlling scaling, which inherits from Animation.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since version 4.1.0(11).

System capability: SystemCapability.Map.Core

Since: 4.1.0(11)

[h2]constructor

constructor(fromX: number, toX: number, fromY: number, toY: number)

Constructor, which is used to construct an animation instance for scale control.

The value 0 indicates that the animation scales down and disappears.

The value 1 indicates no animation scaling.

A value less than 1 indicates that the animation scales down.

A value greater than 1 indicates that the animation scales up.

Model restriction: This API can be used only in the stage model.

Atomic service API: This API can be used in atomic services since version 4.1.0(11).

System capability: SystemCapability.Map.Core

Since: 4.1.0(11)

Parameters:

Name Type Mandatory Description
fromX number Yes Horizontal scale factor applied when the animation starts. Negative values are treated as 0, and invalid values are not processed.
toX number Yes Horizontal scale factor applied when the animation ends. Negative values are treated as 0, and invalid values are not processed.
fromY number Yes Vertical scale factor applied when the animation starts. Negative values are treated as 0, and invalid values are not processed.
toY number Yes Vertical scale factor applied when the animation ends. Negative values are treated as 0, and invalid values are not processed.

Example:

let animation: map.ScaleAnimation = new map.ScaleAnimation(1, 3, 1, 3);