liuyg
2021-12-31 c8d5372b039adc272da61a3627dcc1ff898417d4
src/store/modules/mobile.js
@@ -38,6 +38,12 @@
        },
        perspectiveControl: '',//视角控制:高度、角度  ()=>{}
        perspectiveControls: '',//视角控制:高度、角度  ()=>{}
        tilesetLayer: null,//3d模型
        tileset: null,//3d模型
        tilesetLayer: null,//2.5d模型
        usetowpointfive: null,
        tilesetLayer: null,//瀑布流
    },
    mutations: {
        MSET_VIEWER(state, viewer) {
@@ -105,15 +111,33 @@
            if (data == "2D") { // 改数据为3d数据
                state.dimensionData = {// 维度镜头数据
                    heading: 0,
                    pitch: -90,
                    pitch: -45,
                    roll: 0
                };
                // console.log(1321)
                state.wallLayer.show = false; //关闭瀑布   以及2.5d图形贴片
                state.mviewer.imageryLayers.remove(state.newLayer);
                state.newLayer = null;
                // state.silhouetteBlue.selected = []
                state.tilesetLayer.changesilhouetteBlue(); //清空silhouetteBlue.selected = [];
                // console.log(state.tileset)
                state.tilesetLayer.show = true; //显示3d图形
                state.startPointFn();//移动默认视角
                // state.mviewer.flyTo(state.tileset);
            } else if (data == "2.5D") {
                state.dimensionData = {// 维度镜头数据
                    heading: 0,
                    pitch: -90,
                    roll: 0
                };
                state.tilesetLayer.show = false//隐藏3d图形
                state.newLayer = state.usetowpointfive();//添加2.5d图形贴片
                state.wallLayer.show = true//打开瀑布
                state.startPointFn();//移动默认视角
            }
        },
        //切换控制
@@ -121,6 +145,13 @@
            state.perspectiveControl = data;
            state.perspectiveControls = !state.perspectiveControls;
        },
        MSET_MODEOLS(state, data) {
            state.tilesetLayer = data.tilesetLayer;
            state.newLayer = data.newLayer;
            state.wallLayer = data.wallLayer;
            state.tileset = data.tileset;
            state.usetowpointfive = data.usetowpointfive;
        }
    },
    actions: {
        MSET_CREADE({ state, commit, dispatch }) {
@@ -132,27 +163,33 @@
            dispatch("closeMobileWindowsDom");
            let clas, Flys;
            const nowHeight = Math.ceil(state.mviewer.camera.positionCartographic.height);
            console.log(data)
            if (state.dimension == "2D") {
                Flys = [
                    +data.lntLat[0] + 0.01197,
                    +data.lntLat[1] - 0.0001,
                    nowHeight,
                    // +data.lntLat[1] - 0.0001,
                    +data.lntLat[1] - 0.0042,
                    330,
                ]
                clas = [
                    data.from == 'PopupOurOnce' ? +data.lntLat[0] : +data.lntLat[0],
                    data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1],
                    data.from == 'PopupOurOnce' ? 0 : 0
                    // data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1],
                    data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1] - 0.00048,
                    data.from == 'PopupOurOnce' ? 0 : 90.648862227
                ]
            } else if (state.dimension == '2.5D') {
                Flys = [
                    +data.lntLat[0] + 0.01197,
                    +data.lntLat[1] - 0.0022,
                    330
                    +data.lntLat[1] - 0.0001,
                    // +data.lntLat[1] - 0.0022,
                    nowHeight
                ]
                clas = [
                    data.from == 'PopupOurOnce' ? +data.lntLat[0] : +data.lntLat[0],
                    data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1] - 0.00048,
                    data.from == 'PopupOurOnce' ? 0 : 90.648862227
                    data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1],
                    // data.from == 'PopupOurOnce' ? +data.lntLat[1] - 0.00108 : +data.lntLat[1] - 0.00048,
                    // data.from == 'PopupOurOnce' ? 0 : 90.648862227
                    data.from == 'PopupOurOnce' ? 0 : 0
                ]
            }
@@ -270,7 +307,7 @@
                    // pitch: data.pitch,
                    roll: data.roll
                },
                duration: 1.6, // 定位的时间间隔
                duration: 1.5, // 定位的时间间隔
                complete: () => { // 完成后的回调
                    if (data.fn) { // 自定义回调
                        setTimeout(() => {