surprise
2024-04-17 f560ccccd3878497339daeee3241a81c263898f7
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
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
import request from '@/api/request'
import bus from './bus'
import { intensity, getbounds, createPic, picurl } from "@/api/http";
import { Message, Loading } from 'element-ui';
import data from "../utils/data.json"
 
 
 
//白膜
export function loadBaimo(num) {
    //上海小面积白膜
    let url1 = "http://183.162.245.49:8099/SHdata/SH_CLIP_BM/tileset.json"
    let url12 = "http://183.162.245.49:8099/SHdata/LJZ_JM_BM1/tileset.json"
 
    //广州精模 2 3 4
    let url2 = "http://183.162.245.49:82/SG/b3dm/part1.412787/tileset.json"
    let url3 = "http://183.162.245.49:82/SG/b3dm/_3.412788/tileset.json"
    let url4 = "http://183.162.245.49:82/SG/b3dm/_2.413191/tileset.json"
 
    let url6 = "http://183.162.245.49:8099/SHdata/GZ_BM_3DTILE1/tileset.json"//广州白膜
 
 
    let url7 = "http://183.162.245.49:8099/SHdata/LJZJM3DTILES/tileset.json"//上海手工精模
 
 
    let url8 = "http://183.162.245.49:8099/SHdata/SHQX_3dtiles/3dtiles/tileset.json"//飞飞上海倾斜
 
 
    let url9 = "http://183.162.245.49:8099/SHdata/GZ_TH_3DTILE/tileset.json"//广州精模(天河)
    let url10 = "http://183.162.245.49:8099/SHdata/GZ_fujia_2/tileset.json"//广州精模(天河)
    let url11 = "http://183.162.245.49:8099/SHdata/GZ_fujia_3/tileset.json"//广州精模(天河)
 
    let url13 = "http://183.162.245.49:8099/SHdata/SH_CJ/tileset.json"
 
    switch (num) {
        case 1:
            window.model1 = sgworld.Creator.create3DTilesets("", url1, {}, {
            }, "0", true, (data) => {
            });
            window.model12 = sgworld.Creator.create3DTilesets("", url12, {}, {
 
            }, "0", true, (data) => {
            });
            break;
        case 2:
            window.model8 = sgworld.Creator.create3DTilesets("", url8, {}, {
            }, "0", true, (data) => {
            });
            break;
        case 3:
            window.model7 = sgworld.Creator.create3DTilesets("", url7, {}, {
            }, "0", true, (data) => {
            });
            break;
        case 4:
            window.model9 = sgworld.Creator.create3DTilesets("", url9, {}, {
            }, "0", true, (data) => {
            });
            window.model10 = sgworld.Creator.create3DTilesets("", url10, {}, {
            }, "0", true, (data) => {
            });
            window.model11 = sgworld.Creator.create3DTilesets("", url11, {}, {
            }, "0", true, (data) => {
            });
            break;
        case 5:
            window.model2 = sgworld.Creator.create3DTilesets("", url2, {}, {
            }, "0", true, (data) => {
            });
            window.model3 = sgworld.Creator.create3DTilesets("", url3, {}, {
            }, "0", true, (data) => {
            });
            window.model4 = sgworld.Creator.create3DTilesets("", url4, {}, {
            }, "0", true, (data) => {
            });
            break;
        case 6:
            window.model6 = sgworld.Creator.create3DTilesets("", url6, {}, {
 
            }, "0", true, (data) => {
            });
            break;
        case 7:
            window.model13 = sgworld.Creator.create3DTilesets("", url13, {}, {
                edit: {
                    height: 0
                }
            }, "0", true, (data) => {
            });
            break;
        default:
            break;
    }
    //初始添加注记
 
}
//水系
//点
window.deleteObj = []
export function loaddian(urls, name, height) {
    var data = {
        font_family: "微软雅黑",
        font_size: 16,
        pointHeight: height,
        showBackground: true,
        text: name,
        fillColor: "#00ffff",
        outlineColor: "#000000",
        outlineWidth: 2,
        disableDepthTestDistance: Infinity,
        near: 0,
        far: 2000,
    };
    let dx = sgworld.Creator.createLabelPointGeoJsonFeatureLayer("", urls, data, "0", true)
    // 
    window.deleteObj.push(dx)
 
}
//路网
export function loadLW() {
    var urls = "http://183.162.245.49:8099/gisserver/tmsserver/SH_peitu"
    var layer = sgworld.Creator.createUrlTemplateImageryProvider('tms服务', {
        url: Cesium.buildModuleUrl(urls + "/{z}/{x}/{reverseY}.png"),
        Level: 15
    }, '0', undefined, true, "");
    var urls1 = "http://183.162.245.49:8099//gisserver/tmsserver/SH_sj"
    var layer1 = sgworld.Creator.createUrlTemplateImageryProvider('tms服务', {
        url: Cesium.buildModuleUrl(urls1 + "/{z}/{x}/{reverseY}.png"),
        Level: 6
    }, '0', undefined, true, "");
}
//聚合效果
export function juhe(params, name) {
    var url;
    var billboardImage;
    var jhtype;
    var dataSource;
    if (name === "监测站") {
        url = "http://221.224.53.36:9080/gis/monitor/stations";
        billboardImage = "./static/img/jcz.png";
        jhtype = 'GET';
        dataSource = new Cesium.CustomDataSource("jcz");
    } else if (name === "系统台站") {
        url = "http://221.224.53.36:9080/map/searchRsbtStn";
        billboardImage = "./static/img/blue.png";
        jhtype = 'POST';
        dataSource = new Cesium.CustomDataSource("xttz");
    } else if (name === "测试台站") {
    }
    if (!params) {
        if (name === "系统台站") {
            var ds = viewer.dataSources.getByName("xttz");
            if (ds.length > 0) {
                for (var i = 0; i < ds.length; i++) {
                    viewer.dataSources.remove(ds[i]);
                }
            }
            if (window.modelList1.length > 0) {
                for (var j = 0; j < window.modelList1.length; j++) {
                    window.modelList1[j].deleteObject();
                }
            }
        } else if (name === "监测站") {
            var jcz = viewer.dataSources.getByName("jcz");
            if (jcz.length > 0) {
                for (var i = 0; i < jcz.length; i++) {
                    viewer.dataSources.remove(jcz[i]);
                }
            }
            if (window.modelList.length > 0) {
                for (var j = 0; j < window.modelList.length; j++) {
                    window.modelList[j].deleteObject();
                }
            }
        }
 
    } else {
 
        var dataSourcePromise = viewer.dataSources.add(dataSource);
        $.ajax({
            url: url,
            contentType: 'application/json;charset=UTF-8',
            type: jhtype,
            dataType: 'json',
            data: JSON.stringify({}),
            success: function (data) {
                if (data.message == "Success") {
                    let height, lon, lat
                    data.rows.forEach((item) => {
                        height = 100, lon = item.statLg, lat = item.statLa
                        if (item.statName) {
                            item.dataType = "XXTZ";
                            var pixelO = (item.statName.length / 2 * 20)
                            if (item.statName.indexOf("对讲机") == 0) {
                                billboardImage = "./static/img/手机.png";
                            } else {
                                if (item.statName.indexOf("5G") == 0) {
                                    billboardImage = "./static/img/5g.png";
                                } else {
                                    billboardImage = "./static/img/blue.png";
                                }
                            }
                            var tzgltfurl = "./static/gltf/jizhan.glb";
                            switch (item.statName) {
                                case "5G基站4":
                                    lon = 113.31284042
                                    lat = 23.1478328
                                    height = 94.24
                                    break;
                                case "对讲机系统-07":
                                    lon = 113.31746066
                                    lat = 23.14174174
                                    height = 60
                                    break;
                                case "对讲机系统-04":
                                    lon = 113.31971655
                                    lat = 23.14200308
                                    height = 78.30
                                    break;
                                case "对讲机系统-02":
                                    lon = 113.32338867
                                    lat = 23.14155387
                                    height = 159.73
                                    break;
                                case "5G基站2":
                                    lon = 113.32342299
                                    lat = 23.1420382
                                    height = 203.51
                                    break;
                                case "5G基站1":
                                    lon = 113.3154846
                                    lat = 23.13927926
                                    height = 196.47
                                    break;
                                case "对讲机系统-03":
                                    lon = 113.31920459
                                    lat = 23.13935581
                                    height = 100
                                    break;
                                case "4G基站1":
                                    lon = 113.31539679
                                    lat = 23.1375488
                                    height = 295
                                    break;
                                case "对讲机系统-01":
                                    lon = 113.32029651
                                    lat = 23.13864168
                                    height = 63
                                    break;
                                case "对讲机系统-05":
                                    lon = 113.31764205
                                    lat = 23.13788573
                                    height = 86.70
                                    break;
                                case "对讲机系统-06":
                                    lon = 113.32349384
                                    lat = 23.13662137
                                    height = 175
                                    break;
                                case "5G基站5":
                                    lon = 113.31429066
                                    lat = 23.12940111
                                    height = 248.14
                                    break;
                                case "5G基站3":
                                    lon = 113.32796088
                                    lat = 23.13521196
                                    height = 186.33
                                    break;
                                case "越秀区广播电视发射台":
                                    lon = 113.31643235
                                    lat = 23.12389751
                                    height = 255.47
                                    break;
                                default:
                                    break;
                            }
                            if (item.statName.indexOf("明珠")) {
                                height = 500
                            }
                            if (item.statName.indexOf("基站") > -1) {
                                var positionTZ = new Cesium.Cartesian3.fromDegrees(lon, lat, height - 80);
                                loadGLTF(tzgltfurl, positionTZ, 2, "tz")
                            }
                            dataSource.entities.add(new Cesium.Entity({
                                position: Cesium.Cartesian3.fromDegrees(lon, lat, height - 40),
                                label: {
                                    showBackground: true,
                                    backgroundColor: new Cesium.Color.fromCssColorString("#000").withAlpha(0.3),
                                    text: item.statName,
                                    font: "15px Helvetica",
                                    fillColor: Cesium.Color.fromCssColorString("#FCFF00"), pixelOffset: new Cesium.Cartesian2(pixelO, 0),
                                    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                                    disableDepthTestDistance: Number.POSITIVE_INFINITY,
                                    distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
                                },
                                billboard: {
                                    image: billboardImage,
                                    disableDepthTestDistance: Number.POSITIVE_INFINITY,
                                    width: 30, // default: undefined
                                    height: 30,
                                    distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
 
                                },
                                properties: item,
                            }));
                        } else if (item.monstationName) {
                            item.dataType = "JCZ";
                            var gltfurl = "./static/gltf/JCZ.glb";
                            let x = item.monstationLg, y = item.monstationLa
                            let z = 54
                            var position = new Cesium.Cartesian3.fromDegrees(x, y, 0);
                            billboardImage = "./static/img/jcz.png"
                            if (item.monstationName == "云海") {
                                x = 121.444697
                                y = 31.213850
                                gltfurl = "./static/gltf/gdjcz.glb";
                                billboardImage = "./static/img/4.png";
                                position = new Cesium.Cartesian3.fromDegrees(121.444697, 31.213850, 88.5);
                                z = 150
                            }
                            if (item.monstationName.indexOf("小型监测站1") == 0) {
                                gltfurl = "./static/gltf/xxz.glb";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 200);
                                billboardImage = "./static/img/5.png";
                                z = 205
                            }
                            if (item.monstationName.indexOf("小型监测站2") == 0) {
                                gltfurl = "./static/gltf/xxz.glb";
                                x = 113.32349347
                                y = 23.13662572
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 118);
                                billboardImage = "./static/img/5.png";
                                z = 121
                            }
                            if (item.monstationName.indexOf("快部式监测点1") == 0) {
                                gltfurl = "./static/gltf/kbz.glb";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 30);
 
                                billboardImage = "./static/img/2.png";
                                z = 35
                            }
                            if (item.monstationName.indexOf("快部式监测点2") == 0) {
                                gltfurl = "./static/gltf/kbz.glb";
                                x = 113.318593
                                y = 23.140079
                                z = 24
                                billboardImage = "./static/img/2.png";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 17);
                            }
                            if (item.monstationName.indexOf("无人机") == 0) {
                                gltfurl = "./static/gltf/wrj.glb";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 103);
                                z = 108
                                billboardImage = "./static/img/3.png";
                            }
                            if (item.monstationName.indexOf("监测车1") == 0) {
                                gltfurl = "./static/gltf/YDJCC2.glb";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 11.5);
                                z = 17
                                billboardImage = "./static/img/1.png";
                            }
                            if (item.monstationName.indexOf("监测车2") == 0) {
                                gltfurl = "./static/gltf/YDJCC2.glb";
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 11);
                                z = 16
                                billboardImage = "./static/img/1.png";
                            }
                            if (item.monstationName.indexOf("固定监测站") == 0) {
                                gltfurl = "./static/gltf/gdjcz.glb";
                                x = 113.320531
                                y = 23.119995
                                z = 607
                                position = new Cesium.Cartesian3.fromDegrees(x, y, 550);
 
                            }
                            loadGLTF(gltfurl, position, 3, "JCZ")
                            var pixelO = (item.monstationName.length / 2 * 20) + 35
                            dataSource.entities.add(new Cesium.Entity({
                                position: Cesium.Cartesian3.fromDegrees(x, y, z),
                                label: {
                                    showBackground: true,
                                    backgroundColor: new Cesium.Color.fromCssColorString("#000").withAlpha(0.3),
                                    text: item.monstationName,
                                    font: "15px Helvetica",
                                    fillColor: Cesium.Color.fromCssColorString("#6CFF00"),
                                    pixelOffset: new Cesium.Cartesian2(pixelO, 0),
                                    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                                    disableDepthTestDistance: Number.POSITIVE_INFINITY,
                                    distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
                                },
                                billboard: {
                                    image: billboardImage,
                                    disableDepthTestDistance: Number.POSITIVE_INFINITY,
                                    width: 40, // default: undefined
                                    height: 40,
                                    distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
 
                                },
                                properties: item,
                            }));
                        }
 
 
 
                        var pathOption = {
                            width: 1,     //线宽(可选)
                            color: '#00ffff',  //线颜色(可选),
                            height: 5000,
                            LightSpot: true,   //是否使用光点效果(可选)
                            LightSpotColor: '#ffffff',   //光点颜色(可选)
                            inflow: true
 
                        }
 
 
 
 
                        let arr = [{ "lon": 121.3915556, "lat": 31.621555, height: 15 },
                        { "lon": 121.3710465, "lat": 31.3834148, height: 15 },
                        { "lon": 121.222861, "lat": 31.31885, height: 15 },
                        { "lon": 121.33049, "lat": 31.2425713, height: 15 },
                        { "lon": 121.4392777, "lat": 31.1356388, height: 15 },
                        { "lon": 121.628888, "lat": 31.2075, height: 15 },
                        { "lon": 121.886707, "lat": 30.8659381, height: 15 },
                        { "lon": 121.5605555, "lat": 30.8575, height: 15 }]
                        let center = { lat: 31.213850, lon: 121.444697, height: 110 }
                        window.lightStr ? window.lightStr.clear() : ""
                        window.lightStr = sgworld.Creator.createTrailLinePath(center, arr, pathOption);
 
 
                    })
                }
            }
        })
        dataSourcePromise.then(function (dataSource) {
            const pixelRange = 25;
            const minimumClusterSize = 3;
            const enabled = true;
            dataSource.clustering.enabled = enabled;
            dataSource.clustering.pixelRange = pixelRange;
            dataSource.clustering.minimumClusterSize = minimumClusterSize;
            let removeListener;
            const gradient = {
                0.0001: Cesium.Color.DEEPSKYBLUE,
                0.001: Cesium.Color.WHITE,
                0.01: Cesium.Color.ORANGE,
                0.1: Cesium.Color.RED
            };
            function customStyle() {
                if (Cesium.defined(removeListener)) {
                    removeListener();
                    removeListener = undefined;
                } else {
                    removeListener = dataSource.clustering.clusterEvent.addEventListener(
                        function (clusteredEntities, cluster) {
                            cluster.billboard.show = true;
                            // cluster.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY;
                            // cluster.label.font = `bold 12px sans-serif`;
                            cluster.label.font = `12px sans-serif`;
                            cluster.label.fillColor = new Cesium.Color.fromCssColorString("#fff");
                            cluster.label.disableDepthTestDistance = Number.POSITIVE_INFINITY;
                            let allCount = dataSource.entities.values.length || 0
                            for (let key in gradient) {
                                if (clusteredEntities.length >= allCount * key) {
                                    let numLength = String(clusteredEntities.length).length
                                    cluster.billboard.image = _drawCircle(
                                        gradient[key],
                                        numLength
                                    )
                                    cluster.label.show = true
                                    if (numLength === 1) {
                                        cluster.label.pixelOffset = new Cesium.Cartesian2(-2, 3)
                                    } else {
                                        cluster.label.pixelOffset = new Cesium.Cartesian2(
                                            -5 * (numLength - 1),
                                            5
                                        )
                                    }
                                } else if (clusteredEntities.length <= 1) {
                                    cluster.label.show = false
                                }
                            }
                        }
                    );
                }
                // force a re-cluster with the new styling
                const pixelRange = dataSource.clustering.pixelRange;
                dataSource.clustering.pixelRange = 0;
                dataSource.clustering.pixelRange = pixelRange;
            }
            var _cache = {};
            function _drawCircle(color, numLength) {
                let size = 18 * (numLength + 1)
                let key = color.toCssColorString() + '-' + size
                if (!_cache[key]) {
                    let canvas = document.createElement('canvas')
                    canvas.width = size
                    canvas.height = size
                    let context2D = canvas.getContext('2d')
                    context2D.save()
                    context2D.scale(size / 24, size / 24) //Added to auto-generated code to scale up to desired size.
                    context2D.fillStyle = color.withAlpha(0.2).toCssColorString() //Modified from auto-generated code.
                    context2D.beginPath()
                    context2D.arc(12, 12, 9, 0, 2 * Math.PI)
                    context2D.closePath()
                    context2D.fill()
                    context2D.beginPath()
                    context2D.arc(12, 12, 6, 0, 2 * Math.PI)
                    context2D.fillStyle = color.toCssColorString()
                    context2D.fill()
                    context2D.closePath()
                    context2D.restore()
                    _cache[key] = canvas.toDataURL()
                }
                return _cache[key]
            }
            // start with custom style
            customStyle();
        });
 
    }
 
 
 
 
}
 
 
 
//创建glb模型
window.modelList = [];
window.modelList1 = [];
export function loadGLTF(url, position, scale, type) {
    var model = sgworld.Creator.addSimpleGraphic('model', {
        url: url,
        position: position,
        removeEdit: true, // 屏蔽全局标绘编辑功能
        scale: scale
    });
    type == "JCZ" ? window.modelList.push(model) : window.modelList1.push(model)
 
    //viewer.trackedEntity = model;
}
window.showtable = false;
let timeoutID
let handlerMes
window.monstationGuidList = [];
window.stationList = [];
//双击事件
export function addMouseEvent() {
    //点击获取信息
    handlerMes ? handlerMes.destroy() : ""
    handlerMes = new Cesium.ScreenSpaceEventHandler(
        window.Viewer.scene.canvas
    );
 
    handlerMes.setInputAction(function (movement) {
 
        // 判断的目的是防止实例被创建之后左键点击直接导致监测站被分析
        if (window.allowClick) {
            if (window.JCZlist.length > 0) {
                for (var j = 0; j < window.JCZlist.length; j++) {
                    viewer.entities.removeById(window.JCZlist[j].id);
                }
 
            }
            let pick = window.Viewer.scene.pick(movement.position)
            console.log(pick);
            if (pick && pick.id && pick.id.properties && pick.id.properties.monstationName && pick.id.properties.monstationGuid) {
                let i = 0
                if (window.monstationGuidList.length == 0) {
                    window.monstationGuidList.push({ "name": pick.id.properties.monstationName._value, "id": pick.id.properties.monstationGuid._value })
                    bus.$emit("ismonstationGuid", window.monstationGuidList);
                } else {
                    window.monstationGuidList.forEach(item => {
                        if (pick.id.properties.monstationGuid._value == item.id) {
                            i++
                        }
                    });
                    if (i == 0) {
                        window.monstationGuidList.push({ "name": pick.id.properties.monstationName._value, "id": pick.id.properties.monstationGuid._value })
                        bus.$emit("ismonstationGuid", window.monstationGuidList);
                    }
                }
 
            }
            // 选中系统台站
            if (pick && pick.id && pick.id.properties && pick.id.properties._dataType && pick.id.properties._dataType._value == "XXTZ") {
                let i = 0
                debugger
                if (window.stationList.length == 0) {
                    window.stationList.push({ "name": pick.id.properties._statName._value, "id": pick.id.properties._guid._value })
                    bus.$emit("showMoreTZ", window.stationList);
                } else {
                    // 防止重复
                    window.stationList.forEach(item => {
                        if (pick.id.properties._guid._value == item.id) {
                            i++
                        }
                    });
                    if (i == 0) {
                        window.stationList.push({ "name": pick.id.properties._statName._value, "id": pick.id.properties._guid._value })
                        bus.$emit("showMoreTZ", window.stationList);
                    }
                }
 
            }
            clearTimeout(timeoutID);
            timeoutID = window.setTimeout(function () {
                if (!window.showtable) {
                } else {
                    bus.$emit("isFX", true)
                    if (Cesium.defined(pick) && pick.id && pick.id.properties) {
                        window.objform.monstationGuid = pick.id.properties._monstationGuid._value;
                        let data = [
                            window.objform
                        ]
                        window.allowClick = false
                        showdataJCZ(data)
                    }
                }
            }, 200);
        }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    var divPoint3;
    handlerMes.setInputAction(function (movement) {
        clearTimeout(timeoutID);
        if (divPoint3) {
            divPoint3.deleteObject();
        }
        let pick = window.Viewer.scene.pick(movement.position);
        if (Cesium.defined(pick) && pick.id && pick.id.properties) {
            var prophtml = setEpidemicLayerInfoDomtj(pick.id.properties);
            setInterval(function () {
                $("body .closeclick").on("click", () => {
                    document.getElementsByClassName("tableContain")[0].style.display =
                        "none";
                });
            }, 1000);
            if (pick.id.properties.statLg && pick.id.properties.statLa) {
                var lng = pick.id.properties.statLg._value;
                var lat = pick.id.properties.statLa._value;
            } else if (pick.id.properties.monstationLg && pick.id.properties.monstationLa) {
                var lng = pick.id.properties.monstationLg._value;
                var lat = pick.id.properties.monstationLa._value;
            }
            if (pick.id.properties && pick.id.properties._monstationName && pick.id.properties._monstationName._value == "云海") {
                lng = 121.444697
                lat = 31.213850
            }
            if (movement.position)
                divPoint3 = sgworld.Creator.createDivPoint('', { lon: lng, lat: lat, height: 105 }, {
                    type: "custom",
                    offset: ["c", 20],
                    description: prophtml,
                    near: 0,
                    far: 100000
                });
        }
 
    }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
 
}
 
//抽离监测站图例创建事件
export function showdataJCZ(data) {
    const loading = Loading.service({
        lock: true,
        text: "计算中",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)",
    });
    MonitoringStation(data).then((res) => {
        if (res.message === "Success") {
            var positions = res.data.countorResVOList[0].points;
            var value = res.data.countorResVOList[0].areaResult
            var positionsList = [];
            for (var i = 0; i < positions.length; i++) {
                positionsList.push(positions[i].lon, positions[i].lat);
            }
            let obj = {
                name: window.analysisType,
                value: value
            }
            bus.$emit("newData", obj)
            createPloygon(positionsList);
            loading.close();
        }
    }).catch((error) => {
        loading.close();
    });
}
//开启平行光
export function light() {
    // Viewer.scene.light = new Cesium.DirectionalLight({
    //     direction: new Cesium.Cartesian3(0, 0, -1),
    // });
}
//右击事件
let nowplay
export function addRightMouseEvent() {
    //点击获取信息
    let handler = new Cesium.ScreenSpaceEventHandler(
        window.Viewer.scene.canvas
    );
    handler.setInputAction(function (movement) {
        window.divPoint4 && window.divPoint4.deleteObject();
        window.divPoint5 && window.divPoint5.deleteObject();
        window.divPoint6 && window.divPoint6.deleteObject();
        window.divPoint7 && window.divPoint7.deleteObject();
        window.divPoint8 && window.divPoint8.deleteObject();
        window.divPoint9 && window.divPoint9.deleteObject();
        window.divPoint10 && window.divPoint10.deleteObject();
        //清除之前监测站事件
        if (window.JCZlist.length > 0) {
            for (var j = 0; j < window.JCZlist.length; j++) {
                viewer.entities.removeById(window.JCZlist[j].id);
            }
 
        }
        var pick = window.Viewer.scene.pick(movement.position);
        let position = pick.id.position.getValue()
        let degrees = sgworld.Core.toDegrees(position)
        if (Cesium.defined(pick) && pick.id && pick.id.properties) {
            window.showtable = true
            if (pick.id.properties.dataType._value == "JCZ") {
                var lng = pick.id.properties.monstationLg._value;
                var lat = pick.id.properties.monstationLa._value;
                let prophtml = createHtmlRight("黑广播监测能力")
                window.divPoint4 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 170],
                    description: prophtml,
                    near: 0,
                    far: 50000,
                    onclick: function () {
                        window.showtable = true;
                        window.objform = {
                            analysisType: "黑广播",
                            areaResult: 99.83516631,
                            coverageThreshold: "-110",
                            freqPoint: 954,
                            frequency: 100,
                            modelName: "",
                            monFrequency: "",
                            monstationGuid: "2",
                            propModel: 2,
                            rxAntGain: 0,
                            rxAntHeight: 0,
                            txAntGain: 0,
                            txAntHeight: 20,
                            txFrequency: "",
                            txPower: 50
                        }
                        window.objform.monstationGuid = pick.id.properties._monstationGuid._value;
                        let arrq = [window.objform]
                        showdataJCZ(arrq)
                        setTimeout(function name(params) {
                            try {
                                window.divPoint4.deleteObject();
                                window.divPoint5.deleteObject();
                                window.divPoint6.deleteObject();
                                window.divPoint7.deleteObject();
                            } catch (e) {
                            }
                        }, 100)
                    }
                });
                let prophtml1 = createHtmlRight("伪基站监测能力")
                window.divPoint5 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 120],
                    description: prophtml1,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        window.showtable = true;
                        window.objform = {
                            analysisType: "伪基站",
                            areaResult: 10185.58366101,
                            coverageThreshold: "-110",
                            freqPoint: 100,
                            frequency: 954,
                            modelName: "",
                            monFrequency: "",
                            monstationGuid: "2",
                            propModel: 2,
                            rxAntGain: 0,
                            rxAntHeight: 0,
                            txAntGain: 0,
                            txAntHeight: 10,
                            txFrequency: "",
                            txPower: 40
                        }
                        window.objform.monstationGuid = pick.id.properties._monstationGuid._value;
                        let arrq = [window.objform]
                        showdataJCZ(arrq)
                        setTimeout(function name(params) {
                            try {
                                window.divPoint4.deleteObject();
                                window.divPoint5.deleteObject();
                                window.divPoint6.deleteObject();
                                window.divPoint7.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
                    }
                });
                let prophtml2 = createHtmlRight("天线赋形图")
                let scale = 0.5
                window.divPoint6 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 20],
                    description: prophtml2,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        if (window.FieldIntensity) {
                            window.FieldIntensity.deleteObject()
                            window.FieldIntensity = null
                        }
                        let height = degrees.height - 5
                        // 判断赋形图是否需要修改
                        if (pick.id && pick.id._properties && pick.id._properties._monstationName && pick.id._properties._monstationName._value) {
                            let cheak = pick.id._properties._monstationName._value
                            if (cheak.indexOf("小型监测站") == 0 || cheak.indexOf("快部式监测点") == 0) {
                                scale = 0.1
                                height = degrees.height - 2
                            }
                            if (cheak.indexOf("监测车") == 0) {
                                scale = 0.3
                                height = degrees.height - 2
                            }
                        }
                        let url = "./static/json/ant.json"
                        window.FieldIntensity = sgworld.Creator.FieldIntensity(url, {
                            center: [degrees.lon, degrees.lat, height], // 备用中心坐标
                            scale: scale
                        })
                        setTimeout(function name(params) {
                            try {
                                window.divPoint4.deleteObject();
                                window.divPoint5.deleteObject();
                                window.divPoint6.deleteObject();
                                window.divPoint7.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
 
                    }
 
                });
                let prophtml4 = createHtmlRight("对讲机监测能力")
                window.divPoint7 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 70],
                    description: prophtml4,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        window.showtable = true;
                        window.objform = {
                            analysisType: "对讲机",
                            areaResult: 0.451125,
                            coverageThreshold: "-110",
                            freqPoint: 450,
                            frequency: 450,
                            modelName: "",
                            monFrequency: "",
                            monstationGuid: "2",
                            propModel: 2,
                            rxAntGain: 0,
                            rxAntHeight: 0,
                            txAntGain: 0,
                            txAntHeight: 2,
                            txFrequency: "",
                            txPower: 30
                        }
                        window.objform.monstationGuid = pick.id.properties._monstationGuid._value;
                        let arrq = [window.objform]
                        showdataJCZ(arrq)
                        setTimeout(function name() {
                            try {
                                window.divPoint4.deleteObject();
                                window.divPoint5.deleteObject();
                                window.divPoint6.deleteObject();
                                window.divPoint7.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
                    }
                });
 
            }
            if (pick.id.properties.dataType._value == "XXTZ") {
                let prophtml1 = createHtmlRight("保护轮廓线")
                window.divPoint10 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 20],
                    description: prophtml1,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        setTimeout(function name(params) {
                            try {
                                window.divPoint8.deleteObject();
                                window.divPoint9.deleteObject();
                                window.divPoint10.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
                    }
                });
                let prophtml2 = createHtmlRight("天线赋形图")
                let scale = 3
                window.divPoint8 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height+10 }, {
                    type: "custom",
                    offset: ["c", 120],
                    description: prophtml2,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        if (window.FieldIntensity) {
                            window.FieldIntensity.deleteObject()
                            window.FieldIntensity = null
                        }
                        let height = degrees.height - 5
                        let url = "./static/json/ant.json"
                        window.FieldIntensity = sgworld.Creator.FieldIntensity(url, {
                            center: [degrees.lon, degrees.lat, height], // 备用中心坐标
                            scale: scale
                        })
                        setTimeout(function name(params) {
                            try {
                                window.divPoint8.deleteObject();
                                window.divPoint9.deleteObject();
                                window.divPoint10.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
 
                    }
 
                });
                let prophtml4 = createHtmlRight("场强覆盖图")
                window.divPoint9 = sgworld.Creator.createDivPoint('', { lon: degrees.lon, lat: degrees.lat, height: degrees.height }, {
                    type: "custom",
                    offset: ["c", 70],
                    description: prophtml4,
                    near: 0,
                    far: 50000,
                    onclick: function name() {
                        window.showtable = true;
                        window.nowAnalyze = true;
                        window.allowClick = true
                        if (window.imageidXT) {
                            window.Viewer.entities.removeById(window.imageidXT);
                            window.imageidXT = null;
                        }
                        if (!window.nowAnalyze) {
                            return;
                        }
                        let data = {
                            corverageType: 1,
                            coverageRedius_km: 100,
                            coverageThreshold: -100,
                            model: "2",
                            noiseTemp: 293,
                            rxAntGain_dBi: 10,
                            rxAntHeight: 10,
                            station: pick.id.properties.guid._value,
                            type: "1",
                        };
                        const loading = Loading.service({
                            lock: true,
                            text: "计算中",
                            spinner: "el-icon-loading",
                            background: "rgba(0, 0, 0, 0.7)",
                        });
                        intensity(data)
                            .then((res) => {
                                if (res.message === "Success") {
                                    getbounds({ file: Base64.encode(res.data) }).then((res1) => {
                                        if (res1.message === "Success") {
                                            let points = res1.data.points;
                                            let data = {
                                                colorSchemes: 1,
                                                file: Base64.encode(res.data),
                                                maxColor: "FF0000",
                                                maxValue: 100,
                                                minColor: "0000FF",
                                                minValue: 0,
                                            };
                                            nowplay = Base64.encode(res.data);
                                            createPic(data).then((res2) => {
                                                if (res2.message === "Success") {
                                                    let rectangle = sgworld.Creator.addSimpleGraphic(
                                                        "rectangle",
                                                        {
                                                            removeEdit: true,
                                                            coordinates: Cesium.Rectangle.fromDegrees(
                                                                points[0].x,
                                                                points[0].y,
                                                                points[1].x,
                                                                points[1].y
                                                            ),
                                                            color: "rgba(255,255,255,0.5)",
                                                            image:
                                                                "http://221.224.53.36:9081/calc/picurl?file=" +
                                                                Base64.encode(res2.data),
                                                        }
                                                    );
                                                    window.imageidXT = rectangle.id;
 
                                                    loading.close();
                                                }
                                            });
                                        }
                                    });
                                }
                            })
                            .catch((error) => {
                                loading.close();
                            });
 
 
 
 
 
 
 
 
 
 
 
                        setTimeout(function name() {
                            try {
                                window.divPoint8.deleteObject();
                                window.divPoint9.deleteObject();
                                window.divPoint10.deleteObject();
                            } catch (e) {
 
                            }
                        }, 100)
                    }
                });
 
            }
        } else {
            try {
                window.divPoint8.deleteObject();
                window.divPoint9.deleteObject();
                window.divPoint10.deleteObject();
                window.showtable = false
            } catch (e) { }
        }
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
}
// 监测站覆盖评估
export function MonitoringStation(data) {
    return request({
        url: 'calc/stationCover',
        method: 'POST',
        data: data
    })
}
window.JCZlist = [];
export function createPloygon(pos) {
    viewer.scene.globe.depthTestAgainstTerrain = false;
    var poly = viewer.entities.add({
        name: "JCZ",
        polygon: {
            hierarchy: Cesium.Cartesian3.fromDegreesArray(pos),
            extrudedHeight: 1,
            material: Cesium.Color.DARKSALMON.withAlpha(0.3),
            outline: false,
            outlineColor: Cesium.Color.RED,
            arcType: Cesium.ArcType.RHUMB,
        },
        polyline: {
            positions: Cesium.Cartesian3.fromDegreesArray(pos),
            width: 2,
            material: Cesium.Color.RED
        }
    });
    window.JCZlist.push(poly);
 
}
//右击按钮
export function createHtmlRight(data) {
    var html = ``;
    html += `<div class="showRightClickBtn">`
    html += `<button type="button">${data}</button>`
    html += `</div>`
    return html;
}
//监测站弹框
export function setEpidemicLayerInfoDomtj(marker) {
    let tablename, tablevalue
    if (marker.dataType._value == "XXTZ") {
        tablename = ["台站名称", "台站位置", "天线高度(m)", "经度[°]", "维度[°]", "接收起始频率[MHz]", "接受结束频率[MHz]", "发射起始频率[MHz]", "发射结束频率[MHz]", "功率[dBm]"]
        tablevalue = ["statName", "statAddr", "antHight", "statLg", "statLa", "freqUc", "freqEfb", "freqEfe", "freqEfe", "equPow"]
    }
    if (marker.dataType._value == "JCZ") {
        tablename = ["监测设施", "监测设备", "覆盖半径(km)", "设备型号", "设备名称", "经度[°]", "维度[°]", "监测站位置",]
        tablevalue = ["monstationName", "monstationEquName", "monstationLa", "monstationType", "monstationEquName", "monstationLg", "monstationLa", "monstationName"]
    }
    var html = ``;
    html += `<div class="tableContain">`
    html += `<div class="closeclick" >X</div>`
    html += `<div class="tableinner">`
    html += `<table id="mytable" cellspacing="0">
    <caption> </caption> `;
    if (marker.propertyNames) {
        for (var i = 0; i < tablename.length; i++) {
            html += `<tr>
      <td class="row">`+ tablename[i] + `</td>
      <td class="row">`+ marker[tablevalue[i]]._value + `</td>
    </tr>`
 
        }
    } else {
        for (var item in marker) {
            html += `<tr>
      <td class="row">`+ item + `</td>
      <td class="row">`+ marker[item] + `</td>
    </tr>`
        }
    }
    html += `</table>`;
    html += `</div>`
    html += `</div>`
 
 
    return html;
 
}
// mpt地形
let mptYx
export function addMpt(bollean) {
    if (bollean) {
        mptYx ? mptYx.deleteObject() : "";
        mptYx = null
        var option = {
            url: "http://183.162.245.49:82/SG/Elevation",
            layerName: "gz0920.414509",
            requestVertexNormals: true,
        };
        mptYx = sgworld.Creator.sfsterrainprovider("", option, "", true, "");
    } else {
        mptYx ? mptYx.deleteObject() : "";
        mptYx = null
        return
    }
}
 
//监听按钮事件
let status
export function SPPM() {
    tedp.trame.subStyle = {
        left: "1446px",
        top: "2100px"
    }
    window.addEventListener("keydown",
        (event) => {
            if (event.keyCode === 122) {
                event.preventDefault();
                var el = document.documentElement;
                var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;//定义不同浏览器的全屏API
                //执行全屏
                if (typeof rfs != "undefined" && rfs) {
                    rfs.call(el);
                } else if (typeof window.ActiveXObject != "undefined") {
                    var wscript = new ActiveXObject("WScript.Shell");
                    if (wscript != null) {
                        wscript.SendKeys("{F11}");
                    }
                }
 
                //监听不同浏览器的全屏事件,并件执行相应的代码
                document.addEventListener("webkitfullscreenchange", function () {//
                    if (document.webkitIsFullScreen) {
                        //全屏后要执行的代码
                        tedp.trame.subStyle = {
                            left: "1446px",
                            top: "2420px"
                        }
                        document.getElementsByClassName("container")[0].style.height = "2200px"
                        document.getElementsByClassName("containerBtn")[0].style.top = "2300px"
                        status = false
                    } else {
                        tedp.trame.subStyle = {
                            left: "1446px",
                            top: "2120px"
                        }
                        //退出全屏后执行的代码
                        document.getElementsByClassName("container")[0].style.height = "1900px"
                        document.getElementsByClassName("containerBtn")[0].style.top = "1980px"
                    }
                }, false);
            }
        }, true)
}
 
export function addnewPoint(position, name) {
    var gltfurl = "./static/gltf/JCZ.glb";
    var position = new Cesium.Cartesian3.fromDegrees(position.x, position.y, 0);
    loadGLTF(gltfurl, position, 1)
    let dataSource
    var pixelO = (name.length / 2 * 20) + 35
    dataSource.entities.add(new Cesium.Entity({
        position: Cesium.Cartesian3.fromDegrees(position.x, position.y, 10),
        label: {
            showBackground: true,
            backgroundColor: new Cesium.Color.fromCssColorString("#000").withAlpha(0.3),
            text: name,
            font: "15px Helvetica",
            fillColor: Cesium.Color.fromCssColorString("#6CFF00"),
            pixelOffset: new Cesium.Cartesian2(pixelO, 0),
            style: Cesium.LabelStyle.FILL_AND_OUTLINE,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
            distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
        },
        billboard: {
            image: billboardImage,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
            width: 40, // default: undefined
            height: 40,
            distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10, 1000000)
 
        },
        properties: "",
    }));
    window.createTool = false
}
//云海建筑
let yunhaimode1
export function loadYH() {
    let url = "http://183.162.245.49:8099/SHdata/yunhai_3dtile/tileset.json"
    yunhaimode1 = sgworld.Creator.create3DTilesets("", url, {}, {
    }, "0", true, (data) => {
    });
}
 
//绘制多边形
export function drawPolygon() {
    window.datatype && viewer.entities.remove(window.datatype)
    let polygom = sgworld.Creator.createSimpleGraphic('rectangle', { showSize: true, color: "rgba(108,167,247,0.3)" }, function (entity) {
        debugger
        window.datatype = entity
        var pointsList = [];
        var ellipsoid = entity.rectangle.coordinates.getValue()
        for (let i in ellipsoid) {
            let position = Cesium.Math.toDegrees(ellipsoid[i])
            pointsList.push(position);
        }
        pointsList = [[pointsList[1], pointsList[0]], [pointsList[1], pointsList[2]], [pointsList[3], pointsList[2]], [pointsList[3], pointsList[0]]]
        bus.$emit("isdp", pointsList);
    });
 
}