We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesApplication ServicesMap KitArkTS APImap (Map Display)Class (TranslateAnimation)

Class (TranslateAnimation)

Phone5.0.0(12)+PC/2in15.0.1(13)+Tablet5.0.0(12)+Wearable5.1.0(18)+

Modules to Import

Collapse
Word wrap
Dark theme
Copy code
  1. import { map, mapCommon } from '@kit.MapKit';

TranslateAnimation

Animation class for controlling movement, 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)

constructor

Phone5.0.0(12)+PC/2in15.0.1(13)+Tablet5.0.0(12)+Wearable5.1.0(18)+

constructor(target: mapCommon.LatLng)

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

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:

Expand
Name Type Mandatory Description
target mapCommon.LatLng Yes Latitude and longitude of the movement target position. Invalid values are not processed.

Example:

Collapse
Word wrap
Dark theme
Copy code
  1. let target: mapCommon.LatLng = {
  2. latitude: 31,
  3. longitude: 118
  4. };
  5. let animation: map.TranslateAnimation = new map.TranslateAnimation(target);