1
mayisheng
2022-08-15 81f54040c2cb65537c6c6e1db8358a39a57dea0d
src/store/modules/mobile.js
@@ -2,20 +2,61 @@
import axios from 'axios'
import urlParameter from './mobiles/urlParameter'
window.popupsDom = null // mobileDivForms的实体类
window.flytoPosition = null // mobileDivForms的实体类
window.ellipsoid = null
window.cartographic = null
window.useHeight = null
window.vecLayer = null
window.vecLayer = null
window.pointLayer = null
window.drawALineLayerMany = null // 活动线
window.drawALineLayerManycolor = null // 活动线颜色
window.drawALineLayerManyStyle = null // 活动线样式
window.drawALineLayerManypolyline = null // 活动线样式
window.drawAPointLayerMany = null // 活动点
window.drawAPointLayerManyposition = null // 活动点位置
window.drawAPointLayerManyLabels = null // 活动点
// window.tilesetLayer = null;
// window.wallLayer = null;
window.areaLayer = null
window.tileset = null
window.drawALineLayer = null // 导航路径图层
window.drawALineLayerGCJ02StartLngLat = null // 导航路径图层转坐标
window.drawALineLayerGCJ02EndLngLat = null // 导航路径图层转坐标
window.drawALineLayerdrawALine = null // 导航路径画线方法
window.drawALineLayerIcon = null // 导航路径图层图标
window.billboarddaohang = null // 导航点
window.positiondaohang = null // 导航点位置
window.polylinedaohang = null // 导航线
window.polylinematerialdaohang = null // 导航线属性
window.select = {
    // 绿色图层控制显示
    overlay: undefined,
    color: undefined
}
window.tancuanPosition = null
// window.newLayer = null;
// window.usetowpointfive = null;
const mobile = {
    state: {
        ...urlParameter.state, // url参数
        mviewer: null, // 地图实体类
        // mviewer: null, // 地图实体类
        mBigPopup: false, // 全屏弹窗
        popupOurOpenData: [], // 全屏弹窗中下拉菜单数据
        popupTableName: [], // 全屏弹窗标签页数据
        mBigPopupAfter: false, /// /全屏弹窗之前的弹窗
        ips: '', // 获取的ip
        iconHide: false, // 右侧伸缩状态
        iconHide: true, // 右侧伸缩状态
        // DC: '',//DC全局保存
        MobileWindowsHide: true, // 改变点击窗口的显示状态
        MobileWindowChangeData: false, // 改变点击窗口的数据
        popupsDom: '', // mobileDivForms的实体类
        // popupsDom: '', // mobileDivForms的实体类
        query: {}, // 传输数据
        openmobileGoTo: false, // 测试
        ccDataState: false, // 测试
@@ -23,7 +64,7 @@
        MobileWindowsHideFixed: true, // 改变点击窗口的显示状态--固定窗口
        MobileWindowChangeDataFixed: false, // 改变点击窗口的数据--固定窗口
        // 在每次飞行弹窗中  加入自己的点
        pointLayer: null,
        // pointLayer: null,
        pointLayerData: {
            flag: false,
            label: '选择点',
@@ -32,8 +73,6 @@
            checked: '/img/leftnav/way-checked.png',
            layer: 'pointLayer'
        },
        // 默认起始点函数
        startPointFn: '',
        dimension: '2.5D', // 维度
        dimensionData: {
            // 维度镜头数据
@@ -41,33 +80,33 @@
            pitch: -90,
            roll: 0
        },
        zoomRange: [80, 200], // 缩放程度
        zoomRange: [100, 1000], // 缩放程度
        frislayertHeight: 160, // 默认弹窗高度
        perspectiveControl: '', // 视角控制:高度、角度  ()=>{}
        perspectiveControls: '', // 视角控制:高度、角度  ()=>{}
        tilesetLayer: null, // 3d模型
        tileset: null, // 3d模型
        tilesetLayer: null, // 2.5d模型
        usetowpointfive: null,
        tilesetLayer: null, // 瀑布流
        areaLayer: null, // 2.5d事件--绿色图层
        select: {
            // 绿色图层控制显示
            overlay: undefined,
            color: undefined
        },
        // tilesetLayer: null, // 3d模型
        // tileset: null, // 3d模型
        // tilesetLayer: null, // 2.5d模型
        // usetowpointfive: null,
        // wallLayer: null, // 瀑布流
        // areaLayer: null, // 2.5d事件--绿色图层
        // select: {
        //     // 绿色图层控制显示
        //     overlay: undefined,
        //     color: undefined
        // },
        vecLayer: null, // 3D底图
        cvaLayer: null, // 3D底图
        // vecLayer: null, // 3D底图
        // cvaLayer: null, // 3D底图
        audioData: null, // 语音
        audioState: false, // 语音状态
        navigationStartLngLat: '', // 导航起点
        navigationEndLngLat: '', // 导航终点
        drawALineLayer: null, // 导航路径图层
        drawALineLayerIcon: null, // 导航路径图层图标
        // drawALineLayer: null, // 导航路径图层
        // drawALineLayerIcon: null, // 导航路径图层图标
        isOpenDrawALine: false, // 是否开启路径
        endPosition: '', // 传送终点经纬度--
        isendPosition: false, // 传送终点经纬度--感应数据
@@ -77,15 +116,19 @@
        showActivity: false, // 是否显示活动弹窗
        showActivityData: {}, // 活动内容
        drawALineLayerMany: null, // 活动路线图层
        drawAPointLayerMany: null, // 活动点图层
        // drawALineLayerMany: null, // 活动路线图层
        // drawAPointLayerMany: null, // 活动点图层
        isOpenDrawALineMany: null, // 是否开启活动
        seeRight: true // 右侧控制栏显影
        seeRight: true, // 右侧控制栏显影
        pinchFlag: false
    },
    mutations: {
        ...urlParameter.mutations, // url参数
        MSET_VIEWER (state, viewer) {
            state.mviewer = viewer
        // MSET_VIEWER (state, viewer) {
        //     global.viewer = viewer
        // },
        SET_PINCHFLAG (state, pinchFlag) {
            state.pinchFlag = pinchFlag
        },
        MSET_BIGPOPUP (state, viewer) {
            state.mBigPopup = viewer
@@ -113,9 +156,9 @@
            state.ccDataState = !state.ccDataState // 专门测试
            state.query = viewer
        },
        MSET_POPUPDOM (state, viewer) {
            state.popupsDom = viewer
        },
        // MSET_POPUPDOM(state, viewer) {
        //     window.popupsDom = viewer
        // },
        MSET_QUERY (state, viewer) {
            state.query = viewer
        },
@@ -129,10 +172,6 @@
            // 固定窗口
            state.MobileWindowChangeDataFixed = !state.MobileWindowChangeDataFixed
            state.MobileWindowsHideFixed = viewer
        },
        // 默认位置
        MSET_MORENWEIZHI (state, data) {
            state.startPointFn = data
        },
        // // 开关飞入点图标
        // MSET_OPENPOINTEL(state, val) {
@@ -152,6 +191,12 @@
        set_frislayertHeight (state, data) {
            state.frislayertHeight = data
        },
        SET_DIMENSION (state, dimension) {
            state.dimension = dimension
        },
        SET_DIMENSIONDATA (state, dimensionData) {
            state.dimensionData = dimensionData
        },
        // 切换2D和2.5D
        MSET_DIMENSION (state, data) {
            // 关闭弹窗
@@ -166,56 +211,51 @@
                    roll: 0
                }
                // 加载底图
                state.vecLayer = state.mviewer.imageryLayers.addImageryProvider(
                    new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                        url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                        type: 'wmts',
                        layer: 'vec',
                        style: 'default',
                        format: 'tiles',
                        tileMatrixSetID: 'w',
                        show: true,
                        maximumLevel: 18
                    })
                )
                state.cvaLayer = state.mviewer.imageryLayers.addImageryProvider(
                    new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                        url: ' http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                        type: 'wmts',
                        layer: 'cva',
                        style: 'default',
                        format: 'tiles',
                        tileMatrixSetID: 'w',
                        show: true,
                        maximumLevel: 18
                    })
                )
                // 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);
                state.areaLayer.show = false // 绿布
                if (!window.vecLayer) {
                    // window.vecLayer = global.viewer.imageryLayers.addImageryProvider(
                    //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                    //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0',
                    //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                    //         format: 'image/jpeg',
                    //         show: true,
                    //         maximumLevel: 18
                    //     })
                    // )
                    // window.cvaLayer = global.viewer.imageryLayers.addImageryProvider(
                    //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                    //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0',
                    //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                    //         format: 'image/jpeg',
                    //         show: true,
                    //         maximumLevel: 18
                    //     })
                    // )
                }
                // console.log(1321)
                window.wallLayer.show = false // 关闭瀑布   以及2.5d图形贴片
                global.viewer.imageryLayers.remove(window.newLayer)
                window.newLayer = null
                // state.silhouetteBlue.selected = []
                // window.tilesetLayer.changesilhouetteBlue(); //清空silhouetteBlue.selected = [];
                // console.log(window.tileset)
                window.tilesetLayer.show = true // 显示3d图形
                // global.viewer.flyTo(window.tileset);
                window.areaLayer.show = false // 绿布
                // 3D视角不限制
                state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = 80
                global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 80
                // 最大
                state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000000
                global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000000
                // 设置相机缩小时的速率
                state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 10000
                global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 10000
                // 设置相机放大时的速率
                state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                global.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                // 视角平移
                state.mviewer.scene.screenSpaceCameraController.enableRotate = true
                global.viewer.scene.screenSpaceCameraController.enableRotate = true
                // 视角缩放
                state.mviewer.scene.screenSpaceCameraController.enableZoom = true
                global.viewer.scene.screenSpaceCameraController.enableZoom = true
                // 视角旋转
                state.mviewer.scene.screenSpaceCameraController.enableTilt = true
                global.viewer.scene.screenSpaceCameraController.enableTilt = true
            } else if (data == '2.5D') {
                state.dimensionData = {
                    // 维度镜头数据
@@ -227,77 +267,118 @@
                    // roll: 0,
                }
                // 取消3D底图
                // state.mviewer.imageryLayers.remove(state.vecLayer);
                // state.vecLayer = null;
                // state.mviewer.imageryLayers.remove(state.cvaLayer);
                // state.cvaLayer = null;
                // global.viewer.imageryLayers.remove(window.vecLayer);
                // window.vecLayer = null;
                // global.viewer.imageryLayers.remove(window.cvaLayer);
                // window.cvaLayer = null;
                // 加载底图
                state.vecLayer = state.mviewer.imageryLayers.addImageryProvider(
                    new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                        url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                        type: 'wmts',
                        layer: 'vec',
                        style: 'default',
                        format: 'tiles',
                        tileMatrixSetID: 'w',
                        show: true,
                        maximumLevel: 18
                    })
                )
                state.cvaLayer = state.mviewer.imageryLayers.addImageryProvider(
                    new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                        url: ' http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                        type: 'wmts',
                        layer: 'cva',
                        style: 'default',
                        format: 'tiles',
                        tileMatrixSetID: 'w',
                        show: true,
                        maximumLevel: 18
                    })
                )
                state.tilesetLayer.show = false // 隐藏3d图形
                state.newLayer = state.usetowpointfive() // 添加2.5d图形贴片
                state.wallLayer.show = false // 打开瀑布
                state.startPointFn() // 移动默认视角
                state.areaLayer.show = true // 绿布
                // window.vecLayer = global.viewer.imageryLayers.addImageryProvider(
                //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0',
                //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                //         format: 'image/jpeg',
                //         show: true,
                //         maximumLevel: 18
                //     })
                // )
                // window.cvaLayer = global.viewer.imageryLayers.addImageryProvider(
                //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0',
                //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                //         format: 'image/jpeg',
                //         show: true,
                //         maximumLevel: 18
                //     })
                // )
                window.tilesetLayer.show = false // 隐藏3d图形
                window.newLayer = window.usetowpointfive() // 添加2.5d图形贴片
                window.wallLayer.show = false // 打开瀑布
                window.areaLayer.show = true // 绿布
                if (state.zoomRange[3]) {
                    global.viewer.imageryLayers.addImageryProvider(new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                        url: '/fz/{z}/{x}/{y}.png',
                        fileExtension: 'png'
                        // minimumLevel: 19
                    }))
                    // global.viewer.imageryLayers.addImageryProvider(
                    //     new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                    //         url: "http://arcgis.jxpskj.com:6080/arcgis/rest/services/FZ25DMap/MapServer/WMTS",
                    //         layer: "fzsw2019",
                    //         style: "default",
                    //         tileMatrixSetID: "default028mm",
                    //         format: "image/jpgpng",
                    //         tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(),
                    //         maximumLevel: 19,
                    //         tileMatrixLabels: [
                    //             "0",
                    //             "1",
                    //             "2",
                    //             "3",
                    //             "4",
                    //             "5",
                    //             "6",
                    //             "7",
                    //             "8",
                    //             "9",
                    //             "10",
                    //             "11",
                    //             "12",
                    //             "13",
                    //             "14",
                    //             "15",
                    //             "16",
                    //             "17",
                    //             "18",
                    //             "19",
                    //         ],
                    //     })
                    // );
                    // 2.5D视角限制
                    // global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 50
                    // // 最大
                    // global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 9999999999
                } else {
                }
                // 2.5D视角限制
                state.mviewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0]
                global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0]
                // 最大
                state.mviewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1]
                global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1]
                // 设置相机缩小时的速率
                state.mviewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
                global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
                // 设置相机放大时的速率
                state.mviewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                global.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                // 视角平移
                state.mviewer.scene.screenSpaceCameraController.enableRotate = true
                global.viewer.scene.screenSpaceCameraController.enableRotate = true
                // 视角缩放
                state.mviewer.scene.screenSpaceCameraController.enableZoom = true
                global.viewer.scene.screenSpaceCameraController.enableZoom = true
                // 视角旋转
                state.mviewer.scene.screenSpaceCameraController.enableTilt = false
                global.viewer.scene.screenSpaceCameraController.enableTilt = false
            }
        },
        // 绿布
        MSET_areaLayer (state, data) {
            state.areaLayer = data
            window.areaLayer = data
        },
        // 切换控制
        MSET_PERSPECTIVECONTROL (state, data) {
            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
        },
        // MSET_MODEOLS(state, data) {
        //     window.tilesetLayer = data.tilesetLayer
        //     window.newLayer = data.newLayer
        //     window.wallLayer = data.wallLayer
        //     window.tileset = data.tileset
        //     window.usetowpointfive = data.usetowpointfive
        // },
        // 直接移动
        cameraSetView (state, data) {
            state.mviewer.camera.setView({
            global.viewer.camera.setView({
                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                // fromDegrees()方法,将经纬度和高程转换为世界坐标
                // eslint-disable-next-line new-cap
                destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    // 114.0351,
                    // 27.6314,
@@ -321,33 +402,33 @@
        },
        // 删除路线
        removePolyline (state) {
            if (state.drawALineLayer) {
                state.drawALineLayer.remove()
                state.drawALineLayer = null
            if (window.drawALineLayer) {
                window.drawALineLayer.remove()
                window.drawALineLayer = null
                state.isOpenDrawALine = false
            }
        },
        removerPolyLineIcon (state) {
            if (state.drawALineLayerIcon) {
                state.drawALineLayerIcon.remove()
                state.drawALineLayerIcon = null
            if (window.drawALineLayerIcon) {
                window.drawALineLayerIcon.remove()
                window.drawALineLayerIcon = null
            }
        },
        removePolylineMany (state) {
            if (state.drawALineLayerMany) {
                state.drawALineLayerMany.remove()
                state.drawALineLayerMany = null
            if (window.drawALineLayerMany) {
                window.drawALineLayerMany.remove()
                window.drawALineLayerMany = null
                state.isOpenDrawALineMany = false
            }
            if (state.drawAPointLayerMany) {
                state.drawAPointLayerMany.remove()
                state.drawAPointLayerMany = null
            if (window.drawAPointLayerMany) {
                window.drawAPointLayerMany.remove()
                window.drawAPointLayerMany = null
                state.isOpenDrawALineMany = false
            }
        },
        // 显影线路或者点
        showLineOrPoint (state, val) {
            state[val.layer].show = val.flag
            window[val.layer].show = val.flag
        },
        // 传送终点数据
        set_endPosition (state, data) {
@@ -370,8 +451,8 @@
            }
        },
        mset_changeSelect (state, data) {
            state.select.overlay = data[0]
            state.select.color = data[1]
            window.select.overlay = data[0]
            window.select.color = data[1]
        },
        SET_SeeAndNotSee (state, data) {
            state.seeRight = data
@@ -384,8 +465,8 @@
            commit,
            dispatch
        }) {
            state.pointLayer = new global.DC.VectorLayer('pointLayer') // 创建图标实体类
            state.mviewer.addLayer(state.pointLayer) // 添加到地图
            window.pointLayer = new global.DC.VectorLayer('pointLayer') // 创建图标实体类
            global.viewer.addLayer(window.pointLayer) // 添加到地图
        },
        setMobileWindows ({
            state,
@@ -394,12 +475,13 @@
        }, data) {
            // 打开随地图移动窗口
            let clas, Flys
            const nowHeight = Math.ceil(
                state.mviewer.camera.positionCartographic.height
            )
            // const nowHeight = Math.ceil(
            //     global.viewer.camera.positionCartographic.height
            // )
            // 传递响应数据
            commit('MSET_QUERY', data)
            // console.log(data);
            // 配置移动和弹窗的偏移   flys是飞行的偏移  clas是弹窗的偏移
            if (state.dimension == '3D') {
                Flys = [
                    +data.lntLat[0] + 0.01197,
@@ -432,26 +514,28 @@
                    data.from == 'PopupOurOnce' ? 0 : 0
                ]
            }
            window.tancuanPosition = data.position
            // useJWD开启状态  window.tancuanPosition就是根据经纬度来计算出来的 如果有原有的 data.position 把值变为false
            if (data.useJWD) {
                var ellipsoid = state.mviewer.scene.globe.ellipsoid
                var cartographic = global.DC.Namespace.Cesium.Cartographic.fromDegrees(
                window.ellipsoid = global.viewer.scene.globe.ellipsoid
                window.cartographic = global.DC.Namespace.Cesium.Cartographic.fromDegrees(
                    // data.lntLat[0],
                    // data.lntLat[1] - 0.00048,//数值增大是下
                    // "90.648862227"
                    // clnt, clat, calt
                    ...clas
                )
                data.position = ellipsoid.cartographicToCartesian(cartographic)
                window.tancuanPosition = window.ellipsoid.cartographicToCartesian(window.cartographic)
            }
            // 定制化窗体
            const popupsDom = new global.DC.mobileDivForms(state.mviewer, {
            // eslint-disable-next-line new-cap
            window.popupsDom = new global.DC.mobileDivForms(global.viewer, {
                domId: 'mobilePopup',
                title: data.query.name || '成教楼  ',
                className: 'mobilePopup',
                content: document.getElementById('mobile-map_content_content'),
                position: [data.position]
                position: [window.tancuanPosition]
            })
            // commit("MSET_MOBILEWINDOWSHIDE", false)//显示弹窗
            // dispatch("CHANGETOC3", { // 转换坐标
@@ -477,7 +561,7 @@
            //     data.query.from == "地图点击" ? 330 : 330,
            // ]
            const Position = new global.DC.Position( // 转坐标
            window.flytoPosition = new global.DC.Position( // 转坐标
                // +data.lntLat[0] + 0.01197,
                // +data.lntLat[1] - 0.0021,
                // 330,
@@ -490,12 +574,12 @@
                commit('MSET_MOBILEWINDOWSHIDE', true)
            }
            if (
                state.select.overlay != undefined &&
                window.select.overlay != undefined &&
                data.query.fromTo != 'mapClick'
            ) {
                // 关闭绿色边框
                state.select.overlay.setStyle({
                    material: state.select.color,
                window.select.overlay.setStyle({
                    material: window.select.color,
                    outline: false
                })
                commit('mset_changeSelect', [undefined, undefined])
@@ -506,20 +590,20 @@
                // if (true) {
                dispatch('mapFlyTo', {
                    // 飞入
                    lntLat: [Position.lng, Position.lat, Position.alt],
                    heading: Position.heading,
                    pitch: Position.pitch,
                    roll: Position.roll
                    lntLat: [window.flytoPosition.lng, window.flytoPosition.lat, window.flytoPosition.alt],
                    heading: window.flytoPosition.heading,
                    pitch: window.flytoPosition.pitch,
                    roll: window.flytoPosition.roll
                })
            } else {
                dispatch('mapFlyTo', {
                    // 飞入
                    lntLat: [Position.lng, +Position.lat - 0.0003, Position.alt],
                    heading: Position.heading,
                    pitch: Position.pitch,
                    roll: Position.roll
                    lntLat: [window.flytoPosition.lng, +window.flytoPosition.lat - 0.0003, window.flytoPosition.alt],
                    heading: window.flytoPosition.heading,
                    pitch: window.flytoPosition.pitch,
                    roll: window.flytoPosition.roll
                })
                // state.mviewer.camera.setView({
                // global.viewer.camera.setView({
                //   // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                //   // fromDegrees()方法,将经纬度和高程转换为世界坐标
                //   destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
@@ -543,7 +627,7 @@
                // commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
            }
            // })
            commit('MSET_POPUPDOM', popupsDom)
            // commit('MSET_POPUPDOM', popupsDom)
        },
        closeMobileWindowsDom ({
            state,
@@ -551,28 +635,28 @@
            dispatch
        }) {
            commit('CLOSE_NOWPOSITION') // 中断定位获取
            if (!state.MobileWindowsHide && state.popupsDom) {
                state.popupsDom.closeOur()
            if (!state.MobileWindowsHide && window.popupsDom) {
                window.popupsDom.closeOur()
                commit('MSET_MOBILEWINDOWSHIDE', true)
                if (state.audioData) {
                    dispatch('MSET_GETAUDIOBEGIN', 'notOpen')
                }
            } // cancel
        },
        CHANGETOC3 ({
            state,
            commit
        }, data) {
            // //转换经纬度坐标 成世界坐标cartesian3
            var ellipsoid = state.mviewer.scene.globe.ellipsoid
            var cartographic = global.DC.Namespace.Cesium.Cartographic.fromDegrees(
                data.lnt,
                data.lat - 0.00006,
                data.alt || '90.648862227'
            )
            var position = ellipsoid.cartographicToCartesian(cartographic)
            return position
        },
        // CHANGETOC3({
        //     state,
        //     commit
        // }, data) {
        //     // //转换经纬度坐标 成世界坐标cartesian3
        //     var ellipsoid = global.viewer.scene.globe.ellipsoid
        //     var cartographic = global.DC.Namespace.Cesium.Cartographic.fromDegrees(
        //         data.lnt,
        //         data.lat - 0.00006,
        //         data.alt || '90.648862227'
        //     )
        //     var position = ellipsoid.cartographicToCartesian(cartographic)
        //     return position
        // },
        SET_OPENWIDOWFIXED ({
            state,
            commit
@@ -582,7 +666,7 @@
            // 显示窗口
            commit('MSET_MOBILEWINDOWSHIDEFIXED', false)
            // 移动地图位置
            state.mviewer.zoomToPosition(
            global.viewer.zoomToPosition(
                new global.DC.Position(
                    data.lntLat[0],
                    data.lntLat[1] - 0.012,
@@ -612,7 +696,7 @@
            commit,
            dispatch
        }, data) {
            state.mviewer.camera.flyTo({
            global.viewer.camera.flyTo({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    data.lntLat[0] - 0.012,
                    data.lntLat[1],
@@ -675,51 +759,51 @@
            // });
        },
        // 飞入点加入位置
        MSET_POINTDATA ({
            state,
            commit,
            dispatch
        }, data) {
            // 加入坐标
            const positions = new global.DC.Position(
                data[0] - 0.0119,
                data[1] + 0.0111,
                0
            )
            const billboard = new global.DC.Billboard(
                positions,
                '/img/leftnav/map-panorama.png'
            )
            billboard.size = [16, 16]
            // 订阅事件3
            billboard.on(global.DC.MouseEventType.CLICK, (e) => {
                // 定制化窗体
                const query = {
                    name: '选择点'
                }
                const intLat = [e.wgs84Position.lng, e.wgs84Position.lat]
                const d = {
                    position: null,
                    lntLat: intLat,
                    query: {
                        ...(query || {}),
                        introduce: null,
                        address: intLat
                    },
                    useJWD: true // 仅使用经纬度
                }
                dispatch('setMobileWindows', d)
            })
            state.pointLayer.addOverlay(billboard) // 实景
            // commit("MSET_OPENPOINTEL", true);
        },
        // MSET_POINTDATA({
        //     state,
        //     commit,
        //     dispatch
        // }, data) {
        //     // 加入坐标
        //     const positions = new global.DC.Position(
        //         data[0] - 0.0119,
        //         data[1] + 0.0111,
        //         0
        //     )
        //     const billboard = new global.DC.Billboard(
        //         positions,
        //         '/img/leftnav/map-panorama.png'
        //     )
        //     billboard.size = [16, 16]
        //     // 订阅事件3
        //     billboard.on(global.DC.MouseEventType.CLICK, (e) => {
        //         // 定制化窗体
        //         const query = {
        //             name: '选择点'
        //         }
        //         const intLat = [e.wgs84Position.lng, e.wgs84Position.lat]
        //         const d = {
        //             position: null,
        //             lntLat: intLat,
        //             query: {
        //                 ...(query || {}),
        //                 introduce: null,
        //                 address: intLat
        //             },
        //             useJWD: true // 仅使用经纬度
        //         }
        //         dispatch('setMobileWindows', d)
        //     })
        //     window.pointLayer.addOverlay(billboard) // 实景
        //     // commit("MSET_OPENPOINTEL", true);
        // },
        MSET_LOCKPERSPECTIVEL ({
            state,
            commit,
            dispatch
        }, val) {
            // 锁定
            state.mviewer.camera.lookAtTransform(
            global.viewer.camera.lookAtTransform(
                global.DC.Namespace.Cesium.Matrix4.IDENTITY
            )
            // console.log(global.DC.Namespace.Cesium.Matrix4.IDENTITY)
@@ -734,14 +818,14 @@
            // 3d,2.5d转换事件
            commit('MSET_DIMENSION', val)
            // 控制高度
            const height = Math.ceil(
                state.mviewer.camera.positionCartographic.height
            window.useHeight = Math.ceil(
                global.viewer.camera.positionCartographic.height
            )
            state.mviewer.camera.setView({
            global.viewer.camera.setView({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
                    state.mviewer.camera.positionCartographic.longitude,
                    state.mviewer.camera.positionCartographic.latitude,
                    height
                    global.viewer.camera.positionCartographic.longitude,
                    global.viewer.camera.positionCartographic.latitude,
                    window.useHeight
                ),
                orientation: {
                    heading: global.DC.Namespace.Cesium.Math.toRadians(
@@ -762,11 +846,11 @@
            // 测试移动位置
            // commit("MSET_DIMENSION", val);
            // 控制高度
            // const height = Math.ceil(state.mviewer.camera.positionCartographic.height);
            state.mviewer.camera.setView({
            // const height = Math.ceil(global.viewer.camera.positionCartographic.height);
            global.viewer.camera.setView({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
                    state.mviewer.camera.positionCartographic.longitude,
                    state.mviewer.camera.positionCartographic.latitude,
                    global.viewer.camera.positionCartographic.longitude,
                    global.viewer.camera.positionCartographic.latitude,
                    val.height
                ),
                orientation: {
@@ -819,11 +903,11 @@
            state.navigationStartLngLat = [+val.start[0], +val.start[1]] // 导航起点
            state.navigationEndLngLat = [+val.end[0], +val.end[1]] // 导航终点
            // 转换WGS84坐标为GCJ02
            const GCJ02StartLngLat = global.DC.CoordTransform.WGS84ToGCJ02(
            window.drawALineLayerGCJ02StartLngLat = global.DC.CoordTransform.WGS84ToGCJ02(
                Number(state.navigationStartLngLat[0]),
                Number(state.navigationStartLngLat[1])
            )
            const GCJ02EndLngLat = global.DC.CoordTransform.WGS84ToGCJ02(
            window.drawALineLayerGCJ02EndLngLat = global.DC.CoordTransform.WGS84ToGCJ02(
                Number(state.navigationEndLngLat[0]),
                Number(state.navigationEndLngLat[1])
            )
@@ -831,11 +915,11 @@
            let url = 'https://restapi.amap.com/v3/direction/walking' // 默认api步行
            const data = {
                origin: `${Number(GCJ02StartLngLat[0]).toFixed(6)},${Number(
                    GCJ02StartLngLat[1]
                origin: `${Number(window.drawALineLayerGCJ02StartLngLat[0]).toFixed(6)},${Number(
                    window.drawALineLayerGCJ02StartLngLat[1]
                ).toFixed(6)}`,
                destination: `${Number(GCJ02EndLngLat[0]).toFixed(6)},${Number(
                    GCJ02EndLngLat[1]
                destination: `${Number(window.drawALineLayerGCJ02EndLngLat[0]).toFixed(6)},${Number(
                    window.drawALineLayerGCJ02EndLngLat[1]
                ).toFixed(6)}`,
                key: '4b3e1db3211054ce5b466407cbb9d221',
                output: 'json'
@@ -860,13 +944,14 @@
                    const paths = res.data.route.paths
                    for (let i = 0; i < paths.length; i++) {
                        // 多条路线
                        drawALine(paths[i])
                        window.drawALineLayerdrawALine(paths[i])
                    }
                    // const paths = res.data.route.paths[0].steps;
                    // drawALine(paths, res.data.route.paths[0].strategy);
                    // window.drawALineLayerdrawALine (paths, res.data.route.paths[0].strategy);
                })
            // }
            const drawALine = (pathsour) => {
            // 包装绘画工具
            window.drawALineLayerdrawALine = (pathsour) => {
                const paths = pathsour.steps
                const titles = pathsour.strategy
                // paths是个道路对象,其中polyline是String类型的经纬度
@@ -916,35 +1001,33 @@
            // 检查是否存在路线
            commit('removePolyline')
            commit('removePolylineMany')
            const color =
                global.DC.Namespace.Cesium.Color.fromCssColorString('#409EFF')
            const material = new global.DC.PolylineTrailMaterialProperty({
                color: color,
                speed: 10
            })
            state.drawALineLayer = new global.DC.VectorLayer('lineLayer')
            state.mviewer.addLayer(state.drawALineLayer)
            window.drawALineLayer = new global.DC.VectorLayer('lineLayer')
            global.viewer.addLayer(window.drawALineLayer)
            // 如果是添加  给第一个点加入图标 和事件
            if (value[1]) {
                commit('removerPolyLineIcon')
                state.drawALineLayerIcon = new global.DC.VectorLayer('pointLayer')
                state.mviewer.addLayer(state.drawALineLayerIcon)
                window.drawALineLayerIcon = new global.DC.VectorLayer('pointLayer')
                global.viewer.addLayer(window.drawALineLayerIcon)
                const useStr = Str.split(';')
                const post = useStr[useStr.length - 1].split(',')
                const position = new global.DC.Position(post[0], post[1])
                const billboard = new global.DC.Billboard(
                    position,
                window.positiondaohang = new global.DC.Position(post[0], post[1])
                window.billboarddaohang = new global.DC.Billboard(
                    window.positiondaohang,
                    'img/dingwei/dingwei1.png'
                ) // 加入绘画点
                billboard.setStyle({
                window.billboarddaohang.setStyle({
                    pixelOffset: {
                        x: 0,
                        y: -17
                    } // 偏移像素
                })
                // 订阅事件
                billboard.on(global.DC.MouseEventType.CLICK, (e) => {
                window.billboarddaohang.on(global.DC.MouseEventType.CLICK, (e) => {
                    if (state.pinchFlag == true) {
                        return
                    }
                    // console.log(e);
                    // return;
                    // 定制化窗体
@@ -963,15 +1046,15 @@
                    }
                    dispatch('setMobileWindows', windowData)
                })
                state.drawALineLayerIcon.addOverlay(billboard)
                window.drawALineLayerIcon.addOverlay(window.billboarddaohang)
            }
            const polyline = new global.DC.Polyline(Str) // 加入线
            polyline.setStyle({
            window.polylinedaohang = new global.DC.Polyline(Str) // 加入线
            window.polylinedaohang.setStyle({
                width: 3,
                material: material,
                material: window.polylinematerialdaohang,
                clampToGround: true
            })
            state.drawALineLayer.addOverlay(polyline)
            window.drawALineLayer.addOverlay(window.polylinedaohang)
            state.isOpenDrawALine = true
            // commit("cameraSetView", state.navigationStartLngLat); //移动
@@ -987,35 +1070,42 @@
            commit('removePolyline')
            commit('removerPolyLineIcon')
            const Strs = value[0]
            const red = global.DC.Namespace.Cesium.Color.fromCssColorString('#FF0000')
            const white = global.DC.Namespace.Cesium.Color.fromCssColorString('#fff')
            const blue = global.DC.Namespace.Cesium.Color.fromCssColorString('#2196F3')
            const material = new global.DC.PolylineTrailMaterialProperty({
                color: red,
                speed: 10
            })
            const material1 = new global.DC.PolylineImageTrailMaterialProperty({
                color: red,
            window.drawALineLayerManycolor = global.DC.Namespace.Cesium.Color.fromCssColorString('#FF0000')
            // const white = global.DC.Namespace.Cesium.Color.fromCssColorString('#fff')
            // const blue = global.DC.Namespace.Cesium.Color.fromCssColorString('#2196F3')
            // const material = new global.DC.PolylineTrailMaterialProperty({
            //     color: red,
            //     speed: 10
            // })
            window.drawALineLayerManyStyle = new global.DC.PolylineImageTrailMaterialProperty({
                // color: window.drawALineLayerManycolor,
                // speed: 60,
                // image: 'img/icon/right.png',
                // repeat: {
                //     x: 320,
                //     y: 1
                // }
                color: global.DC.Namespace.Cesium.Color.fromBytes(10, 255, 10),
                speed: 60,
                image: 'img/icon/right.png',
                image: '/img/icon/right.png',
                repeat: {
                    x: 320,
                    y: 1
                }
            })
            const drawALineLayerMany = new global.DC.VectorLayer('manyLinePointLayer')
            state.mviewer.addLayer(drawALineLayerMany)
            const drawAPointLayerMany = new global.DC.HtmlLayer('manyPointPointLayer')
            state.mviewer.addLayer(drawAPointLayerMany)
            window.drawALineLayerMany = new global.DC.VectorLayer('manyLinePointLayer')
            global.viewer.addLayer(window.drawALineLayerMany)
            window.drawAPointLayerMany = new global.DC.VectorLayer('manyPointPointLayer')
            global.viewer.addLayer(window.drawAPointLayerMany)
            // 多条线
            for (const k in Strs) {
                const polyline = new global.DC.Polyline(Strs[k].value) // 加入绘画点
                polyline.setStyle({
                window.drawALineLayerManypolyline = new global.DC.Polyline(Strs[k].value) // 加入线
                window.drawALineLayerManypolyline.setStyle({
                    width: 6,
                    material: material1,
                    material: window.drawALineLayerManyStyle,
                    clampToGround: true
                })
                drawALineLayerMany.addOverlay(polyline)
                window.drawALineLayerMany.addOverlay(window.drawALineLayerManypolyline)
                // let post = Strs[k].value.split(";")[0].split(",");
                // let position = new global.DC.Position(post[0], post[1]);
                // let Label = new global.DC.Label(position, Strs[k].name);
@@ -1034,7 +1124,7 @@
            const point = value[1]
            for (const k in point) {
                const post = point[k].value
                const position = new global.DC.Position(post[0], post[1])
                window.drawAPointLayerManyposition = new global.DC.Position(post[0], post[1])
                // let billboard = new global.DC.Billboard(
                //   position,
@@ -1064,7 +1154,7 @@
                //   };
                //   dispatch("setMobileWindows", windowData);
                // });
                // drawALineLayerMany.addOverlay(billboard);
                // window.drawALineLayerMany.addOverlay(billboard);
                // let Labels = new global.DC.Label(position, point[k].name);
                // Labels.setStyle({
                //   font: "16px sans-serif", // CSS 字体设置
@@ -1076,24 +1166,28 @@
                //   // outlineWidth: 1, //边框大小,
                //   pixelOffset: { x: 0, y: -47 }, //偏移像素
                // });
                const Labels = new global.DC.DivIcon(
                    // new this.DC.Position(Number(item[0]), Number(item[1]), 0),
                    position,
                    `
              <div class="point-entitys-box">
                  <div class="point-logo">
                      <img src="/img/icon/activity.png">
                  </div>
                  <div class="point-title">
                      ${point[k].name}
                  </div>
              </div>
          `
                const billboard = new global.DC.Billboard(
                    window.drawAPointLayerManyposition, '/img/icon/activity.png')
                const label = new global.DC.Label(
                    window.drawAPointLayerManyposition,
                    point[k].name
                )
                // 订阅事件
                Labels.on(global.DC.MouseEventType.CLICK, (e) => {
                    // console.log(e);
                    // return;
                label.setStyle({
                    fillColor: global.DC.Color.RED,
                    style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE,
                    outlineColor: global.DC.Color.WHITE, // 边框颜色
                    outlineWidth: 8, // 边框大小,
                    font: '12px sans-serif',
                    pixelOffset: { x: 0, y: -24 }
                })
                billboard.on(global.DC.MouseEventType.CLICK, (e) => {
                    if (state.pinchFlag == true) {
                        return
                    }
                    if (value[3]) {
                        value[3]()
                    }
@@ -1112,11 +1206,36 @@
                    }
                    dispatch('setMobileWindows', windowData)
                })
                drawAPointLayerMany.addOverlay(Labels)
                // console.log(point[k]);
                label.on(global.DC.MouseEventType.CLICK, (e) => {
                    if (state.pinchFlag == true) {
                        return
                    }
                    if (value[3]) {
                        value[3]()
                    }
                    // 定制化窗体
                    const position = e.position
                    const lntLat = [e.overlay._position._lng, e.overlay._position._lat]
                    const windowData = {
                        position,
                        lntLat,
                        query: {
                            ...(value[2] || {}),
                            position,
                            lntLat
                        },
                        useJWD: true // 仅使用经纬度
                    }
                    dispatch('setMobileWindows', windowData)
                })
                window.urlParameterLayer.addOverlay(billboard) // 加入图标
                window.urlParameterLayer.addOverlay(label)
            }
            state.drawALineLayerMany = drawALineLayerMany
            state.drawAPointLayerMany = drawAPointLayerMany
            // state.drawALineLayerMany = drawALineLayerMany
            // state.drawAPointLayerMany = drawAPointLayerMany
            // state.isOpenDrawALineMany = value[2].name ? value[2].name : true;
            // commit("cameraSetView", state.navigationStartLngLat); //移动
        }