文件名从 src/assets/js/palyTools.js 修改 |
| | |
| | | import configTool from "@/assets/js/configTool"; |
| | | import configTool from "@/assets/js/tool/configTool"; |
| | | import store from "@/store"; |
| | | const palyTools = { |
| | | playIndex: 0, |
| | | isPlay: false, |
| | | data: null, |
| | | time: null, |
| | | depthTestAgainstTerrain: null, |
| | | Init(res) { |
| | | if (res.sourceType != "demoAnimation") return; |
| | | this.data = res.animationDatas; |
| | | this.playIndex = 0; |
| | | this.isPlay = true; |
| | | this.playStart(); |
| | | Viewer.scene.globe.depthTestAgainstTerrain = false; |
| | | this.depthTestAgainstTerrain = Viewer.scene.globe.depthTestAgainstTerrain; |
| | | if (this.depthTestAgainstTerrain) { |
| | | Viewer.scene.globe.depthTestAgainstTerrain = false; |
| | | } |
| | | }, |
| | | stop() { |
| | | clearTimeout(this.time); |
| | | this.time = null; |
| | | this.playIndex = 0; |
| | | this.isPlay = false; |
| | | Viewer.scene.globe.depthTestAgainstTerrain = this.depthTestAgainstTerrain; |
| | | this.depthTestAgainstTerrain = null; |
| | | }, |
| | | playStart() { |
| | | if (this.playIndex > this.data.length - 1) { |