1
shuishen
2022-11-18 37a4a03e1ddef4f66904dccee54b684e73e9a3b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
import $store from '../index'
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.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, // 地图实体类
        mBigPopup: false, // 全屏弹窗
        popupOurOpenData: [], // 全屏弹窗中下拉菜单数据
        popupTableName: [], // 全屏弹窗标签页数据
        mBigPopupAfter: false, /// /全屏弹窗之前的弹窗
        ips: '', // 获取的ip
        iconHide: true, // 右侧伸缩状态
        // DC: '',//DC全局保存
        MobileWindowsHide: true, // 改变点击窗口的显示状态
        MobileWindowChangeData: false, // 改变点击窗口的数据
        // popupsDom: '', // mobileDivForms的实体类
        query: {}, // 传输数据
        openmobileGoTo: false, // 测试
        ccDataState: false, // 测试
        openmobilePanorama: false, // 实景显影
        MobileWindowsHideFixed: true, // 改变点击窗口的显示状态--固定窗口
        MobileWindowChangeDataFixed: false, // 改变点击窗口的数据--固定窗口
        // 在每次飞行弹窗中  加入自己的点
        // pointLayer: null,
        pointLayerData: {
            flag: false,
            label: '选择点',
            img: '/zhjg/img/leftnav/way.png',
            normal: '/zhjg/img/leftnav/way.png',
            checked: '/zhjg/img/leftnav/way-checked.png',
            layer: 'pointLayer'
        },
        dimension: '2.5D', // 维度
        dimensionData: {
            // 维度镜头数据
            heading: 0,
            pitch: -90,
            roll: 0
        },
        zoomRange: [100, 1000], // 缩放程度
        frislayertHeight: 160, // 默认弹窗高度
        perspectiveControl: '', // 视角控制:高度、角度  ()=>{}
        perspectiveControls: '', // 视角控制:高度、角度  ()=>{}
 
        // 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底图
 
        audioData: null, // 语音
        audioState: false, // 语音状态
 
        navigationStartLngLat: '', // 导航起点
        navigationEndLngLat: '', // 导航终点
        // drawALineLayer: null, // 导航路径图层
        // drawALineLayerIcon: null, // 导航路径图层图标
        isOpenDrawALine: false, // 是否开启路径
        endPosition: '', // 传送终点经纬度--
        isendPosition: false, // 传送终点经纬度--感应数据
        routerS: [], // 所有路径
        choiceRouterS: 0, // 当前选择路径
 
        showActivity: false, // 是否显示活动弹窗
        showActivityData: {}, // 活动内容
 
        // drawALineLayerMany: null, // 活动路线图层
        // drawAPointLayerMany: null, // 活动点图层
        isOpenDrawALineMany: null, // 是否开启活动
        seeRight: true, // 右侧控制栏显影
        pinchFlag: false
    },
    mutations: {
        ...urlParameter.mutations, // url参数
        // MSET_VIEWER (state, viewer) {
        //     global.viewer = viewer
        // },
        SET_PINCHFLAG (state, pinchFlag) {
            state.pinchFlag = pinchFlag
        },
        MSET_BIGPOPUP (state, viewer) {
            state.mBigPopup = viewer
            $store.dispatch('closeMobileWindowsDom') // 关闭弹窗
        },
        MSET_BIGPOPUPAFTER (state, viewer) {
            state.mBigPopupAfter = viewer
            $store.dispatch('closeMobileWindowsDom') // 关闭弹窗
        },
        MSET_POPUPOUROPENDATA (state, viewer) {
            state.popupOurOpenData = viewer
        },
        MSET_ICONHIDE (state, viewer) {
            state.iconHide = viewer
        },
        MSET_POPUPTABLENAME (state, viewer) {
            state.popupTableName = viewer
        },
        MSET_MOBILEWINDOWSHIDE (state, viewer) {
            // 随地图移动窗口
            state.MobileWindowChangeData = !state.MobileWindowChangeData
            state.MobileWindowsHide = viewer
        },
        MSETCC_SETCC (state, viewer) {
            state.ccDataState = !state.ccDataState // 专门测试
            state.query = viewer
        },
        // MSET_POPUPDOM(state, viewer) {
        //     window.popupsDom = viewer
        // },
        MSET_QUERY (state, viewer) {
            state.query = viewer
        },
        MSET_OPENMOBILEGOTO (state, viewer) {
            state.openmobileGoTo = viewer
        },
        MSET_OPENMOBILEPANORAMA (state, viewer) {
            state.openmobilePanorama = viewer
        },
        MSET_MOBILEWINDOWSHIDEFIXED (state, viewer) {
            // 固定窗口
            state.MobileWindowChangeDataFixed = !state.MobileWindowChangeDataFixed
            state.MobileWindowsHideFixed = viewer
        },
        // // 开关飞入点图标
        // MSET_OPENPOINTEL(state, val) {
        //     if (val) {
        //         state.pointLayerData.img = state.pointLayerData.checked
        //         state[state.pointLayerData.layer].show = true
        //     } else {
        //         state.pointLayerData.img = state.pointLayerData.normal
        //         state[state.pointLayerData.layer].show = false
        //     }
        // },
        // 送入移动端缩放范围
        set_zoomRange (state, data) {
            state.zoomRange = data
        },
        // 送入默认弹窗高度
        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) {
            // 关闭弹窗
            // 3d,2.5d转换事件
            state.dimension = data
            if (data == '3D') {
                // 改数据为3d数据
                state.dimensionData = {
                    // 维度镜头数据
                    heading: 0,
                    pitch: -45,
                    roll: 0
                }
                // 加载底图
                if (!window.vecLayer) {
                    // window.vecLayer = global.viewer.imageryLayers.addImageryProvider(
                    //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                    //         url: 'https://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
                    //         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: 'https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
                    //         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视角不限制
                global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 80
                // 最大
                global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 4000000
                // 设置相机缩小时的速率
                global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 10000
                // 设置相机放大时的速率
                global.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                // 视角平移
                global.viewer.scene.screenSpaceCameraController.enableRotate = true
                // 视角缩放
                global.viewer.scene.screenSpaceCameraController.enableZoom = true
                // 视角旋转
                global.viewer.scene.screenSpaceCameraController.enableTilt = true
            } else if (data == '2.5D') {
                state.dimensionData = {
                    // 维度镜头数据
                    heading: 0,
                    pitch: -90,
                    roll: 0
                    // heading: global.DC.Namespace.Cesium.Math.toRadians(-9),
                    // pitch: global.DC.Namespace.Cesium.Math.toRadians(-34.54),
                    // roll: 0,
                }
                // 取消3D底图
                // global.viewer.imageryLayers.remove(window.vecLayer);
                // window.vecLayer = null;
                // global.viewer.imageryLayers.remove(window.cvaLayer);
                // window.cvaLayer = null;
                // 加载底图
                // window.vecLayer = global.viewer.imageryLayers.addImageryProvider(
                //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                //         url: 'https://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
                //         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: 'https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
                //         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: "https://dev.jxpskj.com:8023/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视角限制
                global.viewer.scene.screenSpaceCameraController.minimumZoomDistance = state.zoomRange[0]
                // 最大
                global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = state.zoomRange[1]
                // 设置相机缩小时的速率
                global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
                // 设置相机放大时的速率
                global.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
                // 视角平移
                global.viewer.scene.screenSpaceCameraController.enableRotate = true
                // 视角缩放
                global.viewer.scene.screenSpaceCameraController.enableZoom = true
                // 视角旋转
                global.viewer.scene.screenSpaceCameraController.enableTilt = false
            }
        },
        // 绿布
        MSET_areaLayer (state, data) {
            window.areaLayer = data
        },
        // 切换控制
        MSET_PERSPECTIVECONTROL (state, data) {
            state.perspectiveControl = data
            state.perspectiveControls = !state.perspectiveControls
        },
        // 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) {
            global.viewer.camera.setView({
                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                // fromDegrees()方法,将经纬度和高程转换为世界坐标
                // eslint-disable-next-line new-cap
                destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    // 114.0351,
                    // 27.6314,
                    // 200.0
                    data[0],
                    data[1],
                    data[2] || 300
                ),
                orientation: {
                    heading: global.DC.Namespace.Cesium.Math.toRadians(
                        state.dimensionData.heading
                    ),
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(
                        state.dimensionData.pitch
                    ),
                    // heading: data.heading,
                    // pitch: data.pitch,
                    roll: state.dimensionData.roll
                }
            })
        },
        // 删除路线
        removePolyline (state) {
            if (window.drawALineLayer) {
                window.drawALineLayer.remove()
                window.drawALineLayer = null
                state.isOpenDrawALine = false
            }
        },
        removerPolyLineIcon (state) {
            if (window.drawALineLayerIcon) {
                window.drawALineLayerIcon.remove()
                window.drawALineLayerIcon = null
            }
        },
        removePolylineMany (state) {
            if (window.drawALineLayerMany) {
                window.drawALineLayerMany.remove()
                window.drawALineLayerMany = null
                state.isOpenDrawALineMany = false
            }
            if (window.drawAPointLayerMany) {
                window.drawAPointLayerMany.remove()
                window.drawAPointLayerMany = null
                state.isOpenDrawALineMany = false
            }
        },
        // 显影线路或者点
        showLineOrPoint (state, val) {
            window[val.layer].show = val.flag
        },
        // 传送终点数据
        set_endPosition (state, data) {
            state.isendPosition = !state.isendPosition
            state.endPosition = data
        },
        // 传送当前选择的路径
        set_choiceRouterS (state, data) {
            state.choiceRouterS = data
        },
        // 活动窗口是否显示
        set_showActivity (state, data) {
            state.showActivity = data
            if (data.state) {
                state.showActivityData = data.value
                state.showActivity = data.state
            } else {
                state.showActivityData = {}
                state.showActivity = data.state
            }
        },
        mset_changeSelect (state, data) {
            window.select.overlay = data[0]
            window.select.color = data[1]
        },
        SET_SeeAndNotSee (state, data) {
            state.seeRight = data
        }
    },
    actions: {
        ...urlParameter.actions, // url参数
        MSET_CREADE ({
            state,
            commit,
            dispatch
        }) {
            window.pointLayer = new global.DC.VectorLayer('pointLayer') // 创建图标实体类
            global.viewer.addLayer(window.pointLayer) // 添加到地图
        },
        setMobileWindows ({
            state,
            commit,
            dispatch
        }, data) {
            // 打开随地图移动窗口
            let clas, Flys
            // 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,
                    // +data.lntLat[1] - 0.0001,
                    +data.lntLat[1] - 0.0027,
                    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'
                        ? +data.lntLat[1] - 0.00108
                        : +data.lntLat[1] - 0.00048,
                    data.from == 'PopupOurOnce' ? 0 : 30.648862227
                ]
            } else if (state.dimension == '2.5D') {
                Flys = [
                    +data.lntLat[0] + 0.01197,
                    +data.lntLat[1] + 0.00048,
                    // +data.lntLat[1] - 0.0022,
                    // nowHeight,
                    state.frislayertHeight
                ]
                // console.log(nowHeight);
                clas = [
                    data.from == 'PopupOurOnce' ? +data.lntLat[0] : +data.lntLat[0],
                    data.from == 'PopupOurOnce' ? +data.lntLat[1] : +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
                ]
            }
            window.tancuanPosition = data.position
            // useJWD开启状态  window.tancuanPosition就是根据经纬度来计算出来的 如果有原有的 data.position 把值变为false
            if (data.useJWD) {
                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
                )
                window.tancuanPosition = window.ellipsoid.cartographicToCartesian(window.cartographic)
            }
 
            // 定制化窗体
            // 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: [window.tancuanPosition]
            })
            // commit("MSET_MOBILEWINDOWSHIDE", false)//显示弹窗
            // dispatch("CHANGETOC3", { // 转换坐标
            //     lnt: data.lntLat[0],
            //     lat: data.lntLat[1]
            // }).then(res => {
            // console.log(res)
 
            // 基于高度基础设置
            // h:1530
            // lnt: + 0.01187 x轴 大是向左
            // Lat: - 0.0108 y轴 减是上
            // h:4000
            // lnt: + 0.01187 x轴
            // Lat: - 0.0308 y轴
            // h:330
            // lnt: + 0.01197 x轴
            // Lat: - 0.0021 y轴
            // console.log(data.query.from, 78)
            // let Flys = [
            //     data.query.from == "地图点击" ? +data.lntLat[0] + 0.01197 : +data.lntLat[0] + 0.01197,
            //     data.query.from == "地图点击" ? +data.lntLat[1] - 0.0021 : +data.lntLat[1] - 0.0021,
            //     data.query.from == "地图点击" ? 330 : 330,
            // ]
 
            window.flytoPosition = new global.DC.Position( // 转坐标
                // +data.lntLat[0] + 0.01197,
                // +data.lntLat[1] - 0.0021,
                // 330,
                ...Flys,
                0,
                state.dimensionData.pitch
            )
            if (!state.MobileWindowsHide) {
                // 关闭弹窗
                commit('MSET_MOBILEWINDOWSHIDE', true)
            }
            if (
                window.select.overlay != undefined &&
                data.query.fromTo != 'mapClick'
            ) {
                // 关闭绿色边框
                window.select.overlay.setStyle({
                    material: window.select.color,
                    outline: false
                })
                commit('mset_changeSelect', [undefined, undefined])
            }
            // console.log(state.dimension);
            if (state.dimension != '2.5D') {
                // if (true) {
                // if (true) {
                dispatch('mapFlyTo', {
                    // 飞入
                    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: [window.flytoPosition.lng, +window.flytoPosition.lat - 0.0003, window.flytoPosition.alt],
                    heading: window.flytoPosition.heading,
                    pitch: window.flytoPosition.pitch,
                    roll: window.flytoPosition.roll
                })
                // global.viewer.camera.setView({
                //   // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                //   // fromDegrees()方法,将经纬度和高程转换为世界坐标
                //   destination: new global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                //     // 114.0351,
                //     // 27.6314,
                //     // 200.0
                //     Position.lng - 0.012,
                //     Position.lat - 0.0003,
                //     Position.alt || 15000.0
                //   ),
                //   orientation: {
                //     heading: global.DC.Namespace.Cesium.Math.toRadians(
                //       Position.heading
                //     ),
                //     pitch: global.DC.Namespace.Cesium.Math.toRadians(Position.pitch),
                //     // heading: data.heading,
                //     // pitch: data.pitch,
                //     roll: Position.roll,
                //   },
                // });
                // commit("MSET_MOBILEWINDOWSHIDE", false); // 显示弹窗
            }
            // })
            // commit('MSET_POPUPDOM', popupsDom)
        },
        closeMobileWindowsDom ({
            state,
            commit,
            dispatch
        }) {
            commit('CLOSE_NOWPOSITION') // 中断定位获取
            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 = 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
        }, data) {
            // 传递响应数据
            commit('MSET_QUERY', data)
            // 显示窗口
            commit('MSET_MOBILEWINDOWSHIDEFIXED', false)
            // 移动地图位置
            global.viewer.zoomToPosition(
                new global.DC.Position(
                    data.lntLat[0],
                    data.lntLat[1] - 0.012,
                    1530,
                    0,
                    -45
                )
            )
        },
        CLOSE_WIDOWFIXED ({
            state,
            commit
        }) {
            // 隐藏窗口
            if (!state.MobileWindowsHideFixed) {
                commit('MSET_MOBILEWINDOWSHIDEFIXED', true)
            }
        },
        // 加入当时的选点
        JOIN_POINT ({
            state,
            commit
        }, data) { },
        // flyTo
        mapFlyTo ({
            state,
            commit,
            dispatch
        }, data) {
            global.viewer.camera.flyTo({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    data.lntLat[0] - 0.012,
                    data.lntLat[1],
                    data.lntLat[2] || 15000.0
                ),
                // destination: data.res,
                orientation: {
                    heading: global.DC.Namespace.Cesium.Math.toRadians(data.heading),
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(data.pitch),
                    // heading: data.heading,
                    // pitch: data.pitch,
                    roll: data.roll
                },
                duration: 1, // 定位的时间间隔
                complete: () => {
                    // 完成后的回调
                    if (data.fn) {
                        // 自定义回调
                        setTimeout(() => {
                            data.fn()
                        }, 200)
                    }
                    if (!data.noOpen) {
                        setTimeout(() => {
                            // dispatch("MSET_POINTDATA", data.lntLat);//传入标记点
                            !state.MobileWindowsHide ||
                                commit('MSET_MOBILEWINDOWSHIDE', false) // 显示弹窗
                        }, 100)
                    }
                }
            })
            // 官网flyto使用方法
            // 1. Fly to a position with a top-down view
            // viewer.camera.flyTo({
            //     destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
            // });
 
            // // 2. Fly to a Rectangle with a top-down view
            // viewer.camera.flyTo({
            //     destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
            // });
 
            // // 3. Fly to a position with an orientation using unit vectors.
            // viewer.camera.flyTo({
            //     destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
            //     orientation : {
            //         direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
            //         up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
            //     }
            // });
 
            // // 4. Fly to a position with an orientation using heading, pitch and roll.
            // viewer.camera.flyTo({
            //     destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
            //     orientation : {
            //         heading : Cesium.Math.toRadians(175.0),
            //         pitch : Cesium.Math.toRadians(-35.0),
            //         roll : 0.0
            //     }
            // });
        },
        // 飞入点加入位置
        // 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,
        //         '/zhjg/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) {
            // 锁定
            global.viewer.camera.lookAtTransform(
                global.DC.Namespace.Cesium.Matrix4.IDENTITY
            )
            // console.log(global.DC.Namespace.Cesium.Matrix4.IDENTITY)
        },
        MSET_DIMENSIONS ({
            state,
            commit,
            dispatch
        }, val) {
            // 关闭弹窗
            dispatch('closeMobileWindowsDom')
            // 3d,2.5d转换事件
            commit('MSET_DIMENSION', val)
            // 控制高度
            window.useHeight = Math.ceil(
                global.viewer.camera.positionCartographic.height
            )
            global.viewer.camera.setView({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
                    global.viewer.camera.positionCartographic.longitude,
                    global.viewer.camera.positionCartographic.latitude,
                    window.useHeight
                ),
                orientation: {
                    heading: global.DC.Namespace.Cesium.Math.toRadians(
                        state.dimensionData.heading
                    ), // 方向
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(
                        state.dimensionData.pitch
                    ), // 倾斜角度
                    roll: state.dimensionData.roll
                }
            })
        },
        MSET_GOTOCC ({
            state,
            commit,
            dispatch
        }, val) {
            // 测试移动位置
            // commit("MSET_DIMENSION", val);
            // 控制高度
            // const height = Math.ceil(global.viewer.camera.positionCartographic.height);
            global.viewer.camera.setView({
                destination: global.DC.Namespace.Cesium.Cartesian3.fromRadians(
                    global.viewer.camera.positionCartographic.longitude,
                    global.viewer.camera.positionCartographic.latitude,
                    val.height
                ),
                orientation: {
                    heading: global.DC.Namespace.Cesium.Math.toRadians(val.heading), // 方向
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(val.pitch), // 倾斜角度
                    roll: val.roll
                }
            })
        },
        // 文字转语音控制↓
        MSET_GETAUDIO ({
            state,
            commit,
            dispatch
        }, val) {
            state.audioData = new window.SpeechSynthesisUtterance()
            state.audioData.text = val
            state.audioData.onstart = function (e) {
                state.audioState = true
            }
            state.audioData.onend = function (event) {
                state.audioState = false
            }
        },
        MSET_GETAUDIOBEGIN ({
            state,
            commit,
            dispatch
        }, val) {
            if (state.audioState) {
                window.speechSynthesis.cancel()
                state.audioState = false
            } else {
                if (val != 'notOpen') {
                    window.speechSynthesis.speak(state.audioData)
                }
            }
        },
        // 文字转语音控制↑
        // 导航系统↓
        MSET_GOTOWHERE ({
            state,
            commit,
            dispatch
        }, val) {
            state.routerS = [] // 清空存着的路径
            // 单条步行
            // 本地图使用的是WGS84坐标,而高德使用的是火星坐标GCJ02,所以需要转换参数过去
            // 返回值需要转换为WGS84坐标
            state.navigationStartLngLat = [Number(val.start[0]).toFixed(6), Number(val.start[1]).toFixed(6)] // 导航起点
            state.navigationEndLngLat = [Number(val.end[0]).toFixed(6), Number(val.end[1]).toFixed(6)] // 导航终点
 
            // 获取路径
            const url = 'https://dev.jxpskj.com:8023/arcgis/rest/services/jglw/NAServer/%E8%B7%AF%E5%BE%84/solve' // 默认api步行
            // const url = 'https://dev.jxpskj.com:8023/arcgis/rest/services/testroad/NAServer/%E8%B7%AF%E5%BE%84/solve' // 默认api步行
            const data = {
                stops: {
                    features: [{
                        geometry: {
                            x: state.navigationStartLngLat[0],
                            y: state.navigationStartLngLat[1]
                        }
                    }, {
                        geometry: {
                            x: state.navigationEndLngLat[0],
                            y: state.navigationEndLngLat[1]
                        }
                    }]
                },
                returnDirections: false,
                returnRoutes: true,
                f: 'json'
            }
            axios
                .get(url, {
                    params: {
                        ...data
                    }
                })
                .then((res) => {
                    // 回调
 
                    let Str = '' // 加入起点
                    res.data.routes.features[0].geometry.paths[0].forEach((item) => {
                        Str += `${item[0]},${item[1]};`
                    })
                    // Str += state.navigationEndLngLat.join(',') // 加入终点
 
                    if (val.fn) {
                        const dataS = {
                            Str: Str
                        }
                        // console.log(Str);
                        state.routerS.push(dataS)
                        return val.fn(dataS)
                    } else {
                        dispatch('MSET_DRAWALINELAYER', Str) // 绘画线路
                    }
                })
        },
        // 导航系统↑
        // 绘画线路
        MSET_DRAWALINELAYER ({
            state,
            commit,
            dispatch
        }, value) {
            // 检查是否存在路线
            commit('removePolyline')
            commit('removePolylineMany')
 
            window.drawALineLayer = new global.DC.VectorLayer('lineLayer')
            global.viewer.addLayer(window.drawALineLayer)
 
            window.polylinedaohang = new global.DC.Polyline(value) // 加入线
            window.polylinedaohang.setStyle({
                width: 4,
                material: global.DC.Color.RED,
                clampToGround: true
            })
            window.drawALineLayer.addOverlay(window.polylinedaohang)
 
            state.isOpenDrawALine = true
            // commit("cameraSetView", state.navigationStartLngLat); //移动
        },
        // 绘画线路活动多条
        MSET_DRAWALINELAYERMANY ({
            state,
            commit,
            dispatch
        }, value) {
            // 检查是否存在路线
            commit('removePolylineMany')
            commit('removePolyline')
            commit('removerPolyLineIcon')
            const Strs = value[0]
            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: '/zhjg/img/icon/right.png',
                // repeat: {
                //     x: 320,
                //     y: 1
                // }
                color: global.DC.Namespace.Cesium.Color.fromBytes(10, 255, 10),
                speed: 60,
                image: '/zhjg/img/icon/right.png',
                repeat: {
                    x: 320,
                    y: 1
                }
            })
            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) {
                window.drawALineLayerManypolyline = new global.DC.Polyline(Strs[k].value) // 加入线
                window.drawALineLayerManypolyline.setStyle({
                    width: 6,
                    material: window.drawALineLayerManyStyle,
                    clampToGround: true
                })
                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);
                // Label.setStyle({
                //   font: "16px sans-serif", // CSS 字体设置
                //   scale: 1, //比例
                //   fillColor: white, //文字颜色
                //   showBackground: true, //是否显示背景
                //   backgroundColor: blue, //背景颜色
                //   // outlineColor: white, //边框颜色
                //   // outlineWidth: 10, //边框大小,
                // });
                // drawALineLayerMany.addOverlay(Label);
            }
            // 多个点
            const point = value[1]
            for (const k in point) {
                const post = point[k].value
                window.drawAPointLayerManyposition = new global.DC.Position(post[0], post[1])
 
                // let billboard = new global.DC.Billboard(
                //   position,
                //   // "/zhjg/img/dingwei/dingwei1.png"
                //   "/zhjg/img/icon/activity.png"
                // ); //加入绘画点
                // billboard.setStyle({
                //   pixelOffset: { x: 0, y: -17 }, //偏移像素
                // });
                // //订阅事件
                // billboard.on(global.DC.MouseEventType.CLICK, (e) => {
                //   // console.log(e);
                //   // return;
                //   // 定制化窗体
                //   let position = e.position,
                //     lntLat = [e.overlay._position._lng, e.overlay._position._lat];
                //   let windowData = {
                //     position,
                //     lntLat,
                //     query: {
                //       ...(value[2] || {}),
                //       position,
                //       lntLat,
                //       notAddGoOn: "notAddGoOn",
                //     },
                //     useJWD: true, //仅使用经纬度
                //   };
                //   dispatch("setMobileWindows", windowData);
                // });
                // window.drawALineLayerMany.addOverlay(billboard);
                // let Labels = new global.DC.Label(position, point[k].name);
                // Labels.setStyle({
                //   font: "16px sans-serif", // CSS 字体设置
                //   scale: 1, //比例
                //   fillColor: white, //文字颜色
                //   showBackground: true, //是否显示背景
                //   backgroundColor: blue, //背景颜色
                //   // outlineColor: white, //边框颜色
                //   // outlineWidth: 1, //边框大小,
                //   pixelOffset: { x: 0, y: -47 }, //偏移像素
                // });
                const billboard = new global.DC.Billboard(
                    window.drawAPointLayerManyposition, '/zhjg/img/icon/activity.png')
 
                const label = new global.DC.Label(
                    window.drawAPointLayerManyposition,
                    point[k].name
                )
 
                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]()
                    }
                    // 定制化窗体
                    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)
                })
 
                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.drawAPointLayerMany.addOverlay(billboard) // 加入图标
                window.drawAPointLayerMany.addOverlay(label)
            }
            // state.drawALineLayerMany = drawALineLayerMany
            // state.drawAPointLayerMany = drawAPointLayerMany
            // state.isOpenDrawALineMany = value[2].name ? value[2].name : true;
            // commit("cameraSetView", state.navigationStartLngLat); //移动
        }
    }
}
 
export default mobile