fuchengshen
2022-07-15 e1186e0c9c1a7a47454b73f9cddcf733dce30b32
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
var layer_xingzhengqu_100;
var layer_sifasuo_101;
var layer_shequjiaozheng_102;
var layer_anzhibangjiao_103;
var layer_renmintiaojie_104;
var layer_pudong_gltf_200;
var layer_shanghai_tiles_201;
var layer_shanghai_roads_202;
var layer_sifaju_effect_203;
var layer_shanghai_mask_300;
var msisdn_list;
var open_merge_list = [];
var new_msisdn_list = [];
var model_list = [];
var color_boxs = $("#color_boxs")
var initGraphic
var mr_points_list = []//创建的定位点数组
var new_mr_points_list = []//将定位点改变后的样式存入
var points17 = []
var graphicLayer17
// import data from '../data/sites.js'
var get_JSON = {
    ruijin_url:"http://localhost:4500/dataservice/Bdata?bid="
}
// 页面初始化,创建楼层按键
$(document).ready(function(){
    var btn_box_html = ''
    for(let i=1;i<23;i++){
        btn_box_html += `<button style="margin-right:4px;" class="${i}">F${i}</button>`
    }
    $("#building_btn").append(btn_box_html)
    $.ajax({
        type:'get',
        dataType:'json',
        async:true,
        url:'http://localhost:4500/dataservice/Bdata?bid=get_ruijin_outside&floor_=7',
        success:function(data){
            console.log("e")
            let datas = data.data.data
            console.log(datas)
            for(let i=0;i<datas.length;i++){
                let item = datas[i]
                points17[i] = [item.lon,item.lat] 
            }
            
            const graphic_17 = new mars3d.graphic.WallEntity({
              positions:points17,
              style: {
                closure: true,
                diffHeight: 2,
              }
            })
            graphicLayer17.addGraphic(graphic_17)
            
            
        }
    })
        
})
 
 
 
 
// 调色盘相关事件
var current=null
function getEvent(){
  if(document.all){
  return window.event;//如果是ie
  }
  func=getEvent.caller;
  while(func!=null){
    var arg0=func.arguments[0];
    if(arg0){
      if((arg0.constructor==Event || arg0.constructor ==MouseEvent)||(typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation))
      {
      return arg0;
      }
    }
    func=func.caller;
  }
  return null;
}
 
function doOver() {
  var evt=getEvent();
  var element=evt.srcElement || evt.target;
  var DisColor=document.getElementById("DisColor");
  var HexColor=document.getElementById("HexColor");
  if ((element.tagName=="TD") && (current!=element)) {
    if (current!=null){
      current.style.backgroundColor = current._background
    }
    element._background = element.style.backgroundColor
    DisColor.style.backgroundColor = rgbToHex(element.style.backgroundColor)
    HexColor.value = rgbToHex(element.style.backgroundColor)
    element.style.backgroundColor = "white"
    current = element
  }
}
function rgbToHex(aa){
  if(aa.indexOf("rgb") != -1){
    aa=aa.replace("rgb(","")
    aa=aa.replace(")","")
    aa=aa.split(",")
    r=parseInt(aa[0]);
    g=parseInt(aa[1]);
    b=parseInt(aa[2]);
    r = r.toString(16);
    if (r.length == 1) { r = '0' + r; }
    g = g.toString(16);
    if (g.length == 1) { g = '0' + g; }
    b = b.toString(16);
    if (b.length == 1) { b = '0' + b; }
    return ("#" + r + g + b).toUpperCase();
  }else{
    return aa;
  }
}
function showHistoryPathDetail(itemname,itemid,itemfloor) {
 
  if (mars3d.widget.isActivate("widgets/rruRouterReplay/widget.js")) {
    var detailWiget = mars3d.widget.getClass("widgets/rruRouterReplay/widget.js");
    detailWiget.reloadData({
        "id":itemid,
        "name":itemname,
        "floor":itemfloor
    });
  } else {
    mars3d.widget.activate({
      uri: "widgets/rruRouterReplay/widget.js",
      params: {
        "id":itemid,
        "name":itemname,
        "floor":itemfloor
    }
    });
  }
}
 
 
 
// 瑞金大楼的创建和对其进行的操作
function openFloor(){
    var num = 0;
    var openfl = false;
    var height_list = [];
    // 切换楼层颜色
    
    // 调色板,用于调整大楼外部颜色
 
    // 展开楼层
    $(".open2").click(function(e){
        for(let i = 1;i<model_list.length;i++){
            if(i<7){
                model_list[i].moveTo({
                    position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*i]
                })
            }else{
                model_list[i].moveTo({
                    position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]+15*(i-1)]
                })
            }
        }
    })
    // 合并楼层
    $(".merge").click(function(){
        for(let i = 1;i<model_list.length;i++){
            model_list[i].moveTo({
                position:[model_list[i].options.position[0],model_list[i].options.position[1],model_list[i].options.position[2]]
            })
        }
    })
    // 显示全部
    $(".hide_").click(function(){
        console.log(mr_points_list)
        for(let i=0;i<model_list.length;i++){
            model_list[i].show = true
        }
    })
    // 切换按钮,显示与隐藏调色盘
    $(".change").click(function(){
        $("#color_boxs").toggle();
    })
    // 选取按钮,点击按钮显示相应楼层
    var button_button = $("button")
    button_button.click(function(e){
        new_msisdn_list = []
        // console.log(new_msisdn_list,"opacity")
        // 六楼以下楼层对应相应的按钮,六层时把五楼楼顶和六楼同时隐藏,六楼以上按钮对应到楼层加一
        $(this).addClass('red')
        $(this).siblings('button').removeClass('red')
        let floor_ = e.target.className
        // let floor_end = Number(floor_)
        let floor_end = Number(floor_.slice(0,-3))
        for(let i=0;i<mr_points_list.length;i++){
            new_msisdn_list= []
            let floor = Number(mr_points_list[i].options.position[2])/3
            if(floor_end < floor){
                mr_points_list[i].setStyle({
                    opacity:0,
                    label:{
                        opacity:0
                    }
                })
            }else{
                mr_points_list[i].setStyle({
                    opacity:1,
                    label:{
                        opacity:1
                    }
                })
            }
            new_mr_points_list.push(mr_points_list[i])
        }
        
            if(floor_end<7){
                
                for(let i=1;i<floor_end+1;i++){
                    model_list[i].show = true
                }
                for(let j=floor_end;j<model_list.length;j++){
                    model_list[j].show = false
                }
                
            }else if(floor_end == 7){
                for(let i=1;i<8;i++){
                    model_list[i].show = true
                }
                for(let j=8;j<model_list.length;j++){
                    model_list[j].show = false
                }
            }else{
                for(let i=1;i<floor_end+1;i++){
                    model_list[i+1].show = true
                }
                for(let j=floor_end;j<model_list.length+1;j++){
                    model_list[j+1].show = false
                }
            }
        })
        
    
    var model_lon = 121.462091;
    var model_lat = 31.212238;
    var heading_ =  165
    // 添加医院大楼模型
    const graphicLayer = new mars3d.layer.GraphicLayer({
        id: 203,
        pid: 98,
        name: "上海瑞金医院",
        show: true,
        flyTo:false
    })
    map.addLayer(graphicLayer)
    floorGraphic1 = new mars3d.graphic.ModelEntity({
        position: [model_lon, model_lat, 0], // 楼栋位置
        style: {
            scale:1,
        distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F1.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>一楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic2 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 0], // 楼栋位置
        style: {
            scale:1,
            distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F2.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>二楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic3 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 0], // 楼栋位置
        style: {
            scale:1,
            distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F3-5.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>三楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic4 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 2.8], // 楼栋位置
        style: {
            scale:1,
            distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F3-5.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>四楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic5 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 5.6], // 楼栋位置
        style: {
            scale:1,
            distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F3-5.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>五楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic6 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 8.4], // 楼栋位置
        style: {
            scale:1,
            distanceDisplayCondition_far:100,
        url: "./gltf/Ruijin2/F3-5.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic7 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 1.8], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F5-roof.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>六楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic8 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, -1.1], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>七楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic9 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 2.1], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        popup:`<p>八楼</p>`,
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic10 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 5], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic11 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 7.9], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic12 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 10.7], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic13 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 13.5], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic14 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 16.3], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic15 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 19.1], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic16 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 21.9], // 楼栋位置
        style: {
            scale:1,
        fill:true,
        // opacity:0.7,
        // color:"#ffffff",
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic17 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 24.7], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/F7-16.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic18 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, -5], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic19 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, -2], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic20 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 1], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic21 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 4], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic22 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 7], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic23 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, 10], // 楼栋位置
        style: {
            scale:1,
        url: "./gltf/Ruijin2/L17_220303.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
        rotation:{x:0,y:0,z:180}
    })
    floorGraphic24 = new mars3d.graphic.ModelEntity({
        
        position: [model_lon,model_lat, -6.8], // 楼栋位置
        style: {
            scale:1,
            maximumScale:2,
        url: "./gltf/Ruijin2/F22-roof.gltf",
        heading: heading_,
        color:"#ffff00",
        fill:true
        },
    })
    model_list.push(
        floorGraphic1,
        floorGraphic2,
        floorGraphic3,
        floorGraphic4,
        floorGraphic5,
        floorGraphic6,
        floorGraphic7,
        floorGraphic8,
        floorGraphic9,
        floorGraphic10,
        floorGraphic11,
        floorGraphic12,
        floorGraphic13,
        floorGraphic14,
        floorGraphic15,
        floorGraphic16,
        floorGraphic17,
        floorGraphic18,
        floorGraphic19,
        floorGraphic20,
        floorGraphic21,
        floorGraphic22,
        floorGraphic23,
        floorGraphic24,
        )
    
    for(let i = 0;i<model_list.length;i++){
        graphicLayer.addGraphic(model_list[i])
    }
    if(model_list.length>0){
    var ColorHex=new Array('00','33','66','99','CC','FF')
    var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF')
    
 
      var colorTable=''
      for (i=0;i<2;i++)  //循环2部分
      {
        for (j=0;j<6;j++) //循环6行
        {
          colorTable=colorTable+'<tr height=12>'
          for (k=0;k<3;k++)
          {
            for (l=0;l<6;l++)
            {
              colorTable=colorTable+'<td onclick="test_box()" class="color_box" width=11 style="background-color:#'+ColorHex[k+i*3]+ColorHex[l]+ColorHex[j]+'">'
            }
          }
        }
      }
      colorTable='<table id="color_fbox" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="000000" style="cursor:hand;">'
          +colorTable+'</table>';
      colorpanel.innerHTML=colorTable
      }
      
    
}
 
// 计算高度
function finalHeight(h){
    let h1 = Number(h)
    let h2 = 0
    let h3 = 0
    let h4 = 0
    let h5 = 0
    if(h1<=4.5){
        h5 = 1
    }else{
        h2 = h1-4.5-1
        h3 = h2/2.8
        h4 = Math.floor(h3)+2
        h5 = h4*3
    }
    
    return h5
}
 
// 添加PCI模型
function addPciModel(){
    var PCI_position_layer = new mars3d.layer.GraphicLayer({
        pid:99,
        name:'new_PCI',
        show:false
    })
    map.addLayer(PCI_position_layer)
    $.ajax({
        type:'get',
        dataType:'json',
        async:true,
        url:get_JSON.ruijin_url+'get_rru_info',
        success:function(data){
            var datas_2 = []
            let datas = data.data.data
            for(let i=0;i<datas.length;i++){
                datas_2.push(datas[i])
            }
            let rru_end = unique(datas)
            console.log(rru_end,"rru_end")
            for(let i=0;i<rru_end.length;i++){
                let  item = datas[i]
                let coneGlow = new mars3d.graphic.CircleEntity({
                  position: Cesium.Cartesian3.fromDegrees(Number(item.Longitude),Number(item.Latitude),0),
                  style: {
                    color:'rgba(255, 254, 253, 1.0)',
                    radius: 4,
                    diffHeight:Number(item.AntHight)
                  },
                  popup:`<p>名称:${item.SitenameCN}</p>
                  <p>地址:${item.SiteAddress}</p>
                  <p>编号:${item.eNodeBID}</p>
                  <p>经度:${item.Longitude}</p>
                  <p>纬度:${item.Latitude}</p>
                  <p>高度:${item.AntHight}</p>`,
                  show:true
                })
                PCI_position_layer.addGraphic(coneGlow)
            }
            for(let i=0;i<datas_2.length;i++){
                let item = datas_2[i]
                for(let j=0;j<rru_end.length;j++){
                    if(item.SitenameCN == rru_end[j].SitenameCN||item.SiteAddress === rru_end[j].SiteAddress){
                        item.Longitude = rru_end[j].Longitude
                        item.Latitude = rru_end[j].Latitude
                        item.AntHight = rru_end[j].AntHight
                        let num = Number(item.DirectionalAngle)
                        let plane_pci
                        let h = Number(item.AntHight)
                        if(item.frequencyRange == '1.8G'){
                            plane_pci = addPCIPlane(item,h-7,num,"#ff0000")
                        }else if(item.frequencyRange == '2.1G'){
                            plane_pci = addPCIPlane(item,h+7,num,"#00ff00")
                        }else{
                            plane_pci = addPCIPlane(item,h,num,"#0000ff")
                        }
                        PCI_position_layer.addGraphic(plane_pci)
                    }
                }
            }
            
        },
        error: function (request, textStatus) {
        
        }
    })
}
 
 
// 封装方法,将rru_info获取到的宏站数据去重
function unique(arr) {
    for ( var i = 0, len = arr.length; i < len; i++ ) {
         for ( var j = i + 1, len = arr.length; j < len; j++ ) {
             if (arr[i].SitenameCN === arr[j].SitenameCN||arr[i].SiteAddress === arr[j].SiteAddress) {
                arr.splice(j, 1 );
                j --;         //每刪除一個數j的值就減1 
                len--;       // j值減小時len也要相應減1(減少循環次數,節省性能)    
                // console.log(j,len)
 
            }
        }
    }
    return arr;
}
 
// 调色盘网格点击事件,点击到的颜色对大楼模型颜色进行改变
  function test_box(){
          console.log("我在外边")
          doclick()
      }
  function doclick(){
    console.log("我在里面")
      var evt=getEvent();
      var element=evt.srcElement || evt.target;
      console.log(element.style.backgroundColor)
      if (element.tagName=="TD"){
          console.log(element)
        var bg=rgbToHex(element.style.backgroundColor);
            for(let i=0;i<model_list.length;i++){
                    model_list[i].setStyle({
                        color:bg,
                        fill:true,
                        shadows:Cesium.ShadowMode.ENABLED,
                        colorBlendMode:Cesium.ColorBlendMode.HIGHLIGHT,
                        colorBlendAmountEnabled : true ,
                        colorBlendAmount:0.8
                    })
            }
        return bg;
      }
    }
 
 
// 添加宏站外的PCI,以面的形式展现
function addPCIPlane(item,h,heading,color){
    const primitive = new mars3d.graphic.PlaneEntity({
        
        position: [Number(item.Longitude),Number(item.Latitude),h],
        style: {
            plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_X,10.0),
        // plane_normal: ,
        heading:heading,
        dimensions_x: 3.0,
        dimensions_y: 6.0,
        color: color,
        opacity: 0.4,
        
        // 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
        highlight: {
            opacity: 0.9
        },
        
        },
        popup:`<p>PCI:${item.PCI}</p>
        <p>Sitename:${item.SitenameCN}</p>
        <p>信号:${item.frequencyRange}</p>
        <p>???:${item.EARFCN}</p>
        `,
        description:"文字"
    })
    // PCI_position_layer.addGraphic(primitive)
    return primitive
}
 
 
 
 
// 添加设备定位点
function addMrPosition(){
    var mr_position_graphic = new mars3d.layer.GraphicLayer({
        pid:90,
        name:'设备定位',
        show:false
    })
    map.addLayer(mr_position_graphic)
    $.ajax({
        type:'get',
        dataType:'json',
        async:true,
        url:'http://localhost:4500/dataservice/Bdata?bid=get_mr_correted',
        success:function(data){
            let datas = data.data.data
            console.log(data.data.data,"获取数据")
            for(let i=0;i<datas.length;i++){
                let item = datas[i]
                let height = finalHeight(Number(item.corr_height))
                var map_name_ = new mars3d.graphic.BillboardEntity({
            position: [Number(item.corr_lon), Number(item.corr_lat),height], // 楼栋位置
            // position:[121.4623922,31.212190342686533,height],
            style: {
                image: 'img/end.png',
                scale:0.5,
                opacity:1,
                scaleByDistance_far:500,
                distanceDisplayCondition_far:500,
                scaleByDistance_farValue:0.5,
                scaleByDistance:true,
                visibleDepth:true,
                hasPixelOffset:false,
                distanceDisplayCondition:true,
                label:{
                    text:item.index_,
                    color:"#ffff00",
                    font_size: 15,
                    pixelOffsetY: -20,
                    distanceDisplayCondition: true,
                    distanceDisplayCondition_far: 1500,
                    distanceDisplayCondition_near: 0
                }
            },
            popup:"编号:" +
              item["msisdn"] +
              "<br />时间:" +
              item["id"] +
              "<br />名称:" +
              item["name_"] +
              "<br/><p><a href='#' onclick='javascript:showHistoryPathDetail(" + item["msisdn"] + ",\"" + item["name_"] + "\",\"" + item["height"] + "\")' >轨迹查询</a></p>"
        })
        mr_points_list.push(map_name_)
        mr_position_graphic.addGraphic(map_name_)
                }
            
        }
    })
}
function addpoint17(){
    graphicLayer17 = new mars3d.layer.GraphicLayer()
    map.addLayer(graphicLayer17)
    
      
}
 
 
function addCustomLayers() {
    addPciModel();//PCI位置
    openFloor();//瑞金大楼
    addMrPosition();//设备定位点
    addpoint17();
}