基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/views/ViewAnimation"], (ViewAnimation) => { /* code goes here */ });
ESM:
import ViewAnimation from "@arcgis/core/views/ViewAnimation";
類:
esri/views/ViewAnimation
繼承: ViewAnimation > Accessor
自從:用於 JavaScript 4.0 的 ArcGIS API
用法說明
包含用於檢查動畫狀態的狀態屬性。當動畫具有 finished
時,視圖動畫將被解析;如果動畫是 stopped
,則被拒絕。
reactiveUtils.when(() => view.animation, function(animation) {
console.log(animation.state); // prints out "running"
animation.when(function(animation) {
console.log(animation.state); // prints out "finished"
})
.catch(function(animation) {
console.log(animation.state); // prints out "stopped"
});
});
或者,可以監視狀態屬性的更改:
let animation = view.goTo(target, { speedFactor: 0.1 });
animation.watch("state", function(state) {
switch (state) {
case "finished":
console.log("Animation finished.");
break;
case "stopped":
console.log("Animation stopped.");
break;
}
});
相關用法
- JavaScript ArcGIS ViewAnimation.when用法及代碼示例
- JavaScript ArcGIS View pointer-move事件用法及代碼示例
- JavaScript ArcGIS View.popup用法及代碼示例
- JavaScript ArcGIS Viewpoint.rotation用法及代碼示例
- JavaScript ArcGIS View.tryFatalErrorRecovery用法及代碼示例
- JavaScript ArcGIS View.when用法及代碼示例
- JavaScript ArcGIS View layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS View.timeExtent用法及代碼示例
- JavaScript ArcGIS View.whenLayerView用法及代碼示例
- JavaScript ArcGIS View immediate-click事件用法及代碼示例
- JavaScript ArcGIS View double-click事件用法及代碼示例
- JavaScript ArcGIS View click事件用法及代碼示例
- JavaScript ArcGIS View用法及代碼示例
- JavaScript ArcGIS View.graphics用法及代碼示例
- JavaScript ArcGIS View.fatalError用法及代碼示例
- JavaScript ArcGIS View.navigation用法及代碼示例
- JavaScript ArcGIS View.input用法及代碼示例
- JavaScript ArcGIS View.destroy用法及代碼示例
- JavaScript ArcGIS View key-down事件用法及代碼示例
- JavaScript ArcGIS View.on用法及代碼示例
- JavaScript ArcGIS View drag事件用法及代碼示例
- JavaScript ArcGIS View hold事件用法及代碼示例
- JavaScript ArcGIS View mouse-wheel事件用法及代碼示例
- JavaScript ArcGIS View.container用法及代碼示例
- JavaScript ArcGIS View.ui用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 ViewAnimation。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。