基于北京SDK的方案预演功能
surprise
2024-05-07 087510aa88b0a6b6b5c648907e9dd52394621d47
src/assets/js/tool/palyTools.js
文件名从 src/assets/js/palyTools.js 修改
@@ -1,23 +1,29 @@
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();
    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) {