fuchengshen
2022-06-20 6e8409b56b300c5810c2a772ffa94c384ed81f41
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
<!DOCTYPE html>
<html>
 
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport"
    content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
 
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <meta name="x5-fullscreen" content="true" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
 
  <!--第三方lib-->
  <script type="text/javascript" src="../lib/include-lib.js" libpath="../lib/"
    include="jquery,font-awesome,bootstrap,layer,haoutil,mars3d"></script>
 
  <link href="./css/style.css" rel="stylesheet" />
  <link href="./css/hn.css" rel="stylesheet" />
  <link rel="stylesheet" href="./css/time_search.css">
  <link rel="stylesheet" href="./js/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.css">
  <style>
    .disable {
      pointer-events: none;
    }
 
    .time_line {
      color: aquamarine;
      border: 1px solid red;
      margin: 0;
      /* position: absolute;
      z-index: 0;
      top: 10px; */
      width: 100%;
 
    }
 
    .time_box {
      display: inline-block;
      /* position: absolute; */
      z-index: 10;
      width: 10px;
      height: 10px;
      margin-left: 10px;
      border-radius: 50%;
      background-color: aquamarine;
    }
 
    .message {
      visibility: hidden;
    }
 
    .time_box:hover+span {
      visibility: visible;
    }
 
    #timeline::-webkit-scrollbar {
      display: none;
    }
  </style>
</head>
 
<body class="dark">
  <!--加载前进行操作提示,优化用户体验-->
  <div id="mask" class="signmask" onclick="removeMask()"></div>
 
  <div id="mars3dContainer" class="mars3d-container"></div>
 
  <div class="infoview topWindows">
    <div>
      华能石洞口二厂视角
    </div>
  </div>
 
  <div class="infoview bottomWindows">
    <div>
      <input id="changqu_btn" type="button" class="btn btn-primary" value="厂区" />
      <input id="meipeng_btn" type="button" class="btn btn-primary" value="煤棚" />
      <input id="pengnei_btn" type="button" class="btn btn-primary" value="棚内" />
    </div>
  </div>
  
  <!-- 操作按钮栏 -->
  <div class="infoview infoWindows handle">
    <button type="button" id="meipeng" class="btn btn-primary active" style="width: 100%;">煤棚整体</button>
    <button type="button" id="meipeng_qiang_ding" class="btn btn-primary" style="width: 100%;">墙面棚顶</button>
    <button type="button" id="meipeng_pati_madao" class="btn btn-primary" style="width: 100%;">爬梯马道</button>
    <button type="button" id="meipeng_tiejia" class="btn btn-primary" style="width: 100%;">钢结构架</button>
    <button type="button" id="meipeng_dimian" class="btn btn-primary" style="width: 100%;">煤棚地面</button>
 
    <button type="button" id="test_btn" class="btn btn-primary" style="width: 100%;">测试</button>
    <button type="button" id="point_btn" class="btn btn-primary" style="width: 100%;">煤堆</button>
  </div>
  <!-- 时间线 -->
  <div id="timeline">
  </div>
 
 
  <!-- 日历选择框 -->
 
  <div class="search" style="display: none;">
    <div class="container">
      <form action="" class="form-horizontal">
        <fieldset>
          <div class="controls input-append date form_datetime" data-date="2019-09-16T05:25:07Z"
            data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
            <input size="16" type="text" value="2019-10-01 10:07:00" readonly class="time1">
            <!-- <span class="add-on"><i class="icon-remove"></i></span> -->
            <span class="add-on"><i class="icon-th"></i></span>
          </div>
          <input type="hidden" id="dtp_input1" value="" />
          <div class="controls input-append date form_datetime" data-date="2019-09-16T05:25:07Z"
            data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
            <input size="16" type="text" value="2019-10-01 12:00:00" readonly class="time2">
            <!-- <span class="add-on"><i class="icon-remove"></i></span> -->
            <span class="add-on"><i class="icon-th"></i></span>
          </div>
          <input type="hidden" id="dtp_input1" value="" />
        </fieldset>
      </form>
    </div><br />
    <button class="search_time_btn" style="background-color: #394582;">查询</button>
  </div>
 
 
 
 
  <!-- 煤堆面板,点击时间轴上的点显示对应煤堆信息 -->
  <div id="meidui_message"></div>
 
  <script src="./js/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.js"></script>
  <script src="./js/bootstrap/bootstrap-datepicker/bootstrap-datetimepicker.zh-CN.js"></script>
  <script src="./js/common.js"></script>
  <script type="text/javascript">
    "use script"; //开发环境建议开启严格模式
 
    var map;
    var graphicLayer
    var heading_ = 0
    var work_ = true
    var dou_work
    var dou_data = {
      lon: 121.406729,
      lat: 31.467183,
      height: 14,
      heading: 70
    }
    var dou_params = []
    var model_list = []
    var point_model = []
    var showClockAnimate = false
 
    // var data_url = 'http://127.0.0.1:8001/admin/business/devicegroup/getdata?bid='
    var data_url = 'http://47.92.33.19:8001/admin/business/devicegroup/getdata?bid='
 
 
    var time_btn = $("#time_line button")
    var model_no = 0
    var distance_half = 111319.5;
    var pointPrimitives = null;
    var time_mars = $('.mars-pannel')
    // 页面初始执行的方法
    $(document).ready(function () {
      console.log(time_btn)
      //plan 1:点击按钮式请求数据,并对模型位置进行移动
      $.ajax({
        type: 'get',
        dataType: 'json',
        async: false,//同步
        headers: {
          "Access-Control-Allow-Origin": "*"
          // "Accept": "application/json"
        },
        url: `${data_url}get_dou_params`,
        success: function (data) {
          console.log(data, "ajax_data")
          dou_params = data.data
        },
        error: function (request, textStatus) {
 
        }
      })
 
      // 设置日历面板的时间格式和语言
      $('.form_datetime').datetimepicker({
        language: 'zh-CN',  //设置为中文
        format: 'yyyy-mm-dd hh:ii:00',  //设置日期格式
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1
      });
 
    })
 
 
 
    $(document).on('click', function () {
      console.log("ddd")
      $("#meidui_message").css({ display: 'none' })//隐藏
    });
 
    $("#meidui_message").on('click', function (event) {
      event.stopPropagation();//阻止冒泡
    })
 
    // 初始化地球参数
    function initMap (options) {
      //合并属性参数,可覆盖config.json中的对应配置
      var mapOptions = mars3d.Util.merge(options, {
        scene: {
          center: {
            lat: 31.460107,
            lng: 121.398442,
            alt: 531.23,
            heading: 33,
            pitch: -23,
            roll: 359.8,
          },
          globe: {
            depthTestAgainstTerrain: false,
          },
        },
        control: {
          infoBox: false,
        },
        layers: [
          {
            id: 1,
            name: "华能厂区",
            type: "3dtiles",
            url: "../model/Huanengchangqu_220615/tileset.json",
            position: {
              lng: 121.403676,
              lat: 31.467225,
              alt: -118,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,0)",
            },
            popup: "all",
            show: true,
            scale: 120,
          },
          {
            id: 2,
            name: "煤棚地面",
            type: "3dtiles",
            url: "../model/meipeng_new/meipeng_dimian/tileset.json",
            position: {
              lng: 121.40609,
              lat: 31.467183,
              alt: 10,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,.1)",
            },
            popup: "all",
            show: true,
            rotation: { z: 32 },
            scale: 0.1,
          },
          {
            id: 3,
            name: "爬梯马道",
            type: "3dtiles",
            url: "../model/meipeng_new/meipeng_pati_madao/tileset.json",
            position: {
              lng: 121.40609,
              lat: 31.467183,
              alt: 10,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,.1)",
            },
            popup: "all",
            show: true,
            rotation: { z: 32 },
            scale: 0.1,
          },
          {
            id: 4,
            name: "钢架构架",
            type: "3dtiles",
            url: "../model/meipeng_new/meipeng_tiejia/tileset.json",
            position: {
              lng: 121.40613,
              lat: 31.467183,
              alt: -48,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,.1)",
            },
            popup: "all",
            show: true,
            rotation: { z: 32 },
            scale: 0.1,
          },
          {
            id: 5,
            name: "墙面顶棚",
            type: "3dtiles",
            url: "../model/meipeng_new/meipeng_qiang_ding/tileset.json",
            position: {
              lng: 121.40609,
              lat: 31.467183,
              alt: 10,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,.1)",
            },
            popup: "all",
            show: true,
            rotation: { z: 32 },
            scale: 0.1,
          },
          {
            id: 9,
            name: "test",
            type: "3dtiles",
            url: "../model/ytlhz/tileset.json",
            position: {
              lng: 121.453676,
              lat: 31.417225,
              alt: -118,
            },
            maximumScreenSpaceError: 1,
            maximumMemoryUsage: 1024,
            highlight: {
              type: mars3d.EventType.click, //默认为鼠标移入高亮,也可以指定click单击高亮
              color: "rgba(255,255,255,0)",
            },
            popup: "all",
            show: true,
            scale: 20,
          }
        ],
      });
 
 
      //创建三维地球场景
      map = new mars3d.Map("mars3dContainer", mapOptions);
 
 
      // 创建斗轮机图层
      graphicLayer = new mars3d.layer.GraphicLayer({
        name: "斗轮机",
        show: true
      })
      map.addLayer(graphicLayer)
      var dou_parent = new Cesium.Entity()
      // 加载斗轮机不同的部件
      var dou1 = new mars3d.graphic.ModelEntity({
        position: [121.406729, 31.467183, 14], // 楼栋位置
        style: {
          url: "http://112.74.77.127:9100/hn/doulunji/dizuo/dizuo.gltf",
          scale: 0.6,
          heading: 120
        }
      })
      graphicLayer.addGraphic(dou1)
 
      var dou2 = new mars3d.graphic.ModelEntity({
 
        position: [121.406729, 31.467183, 14], // 楼栋位置
 
        style: {
          url: "http://112.74.77.127:9100/hn/doulunji/dabi/doulunji_dabi.gltf",
          // url: "https://a.amap.com/jsapi_demos/static/gltf/Duck.gltf",
          scale: 0.6
        },
        poup: '<p>我是斗轮</p>',
        tooltip: '<p>我是斗轮</p>',
        allowDrillPick: false,
      })
      graphicLayer.addGraphic(dou2)
 
      var dou3 = new mars3d.graphic.ModelEntity({
 
        position: [121.406729, 31.467183, 14], // 楼栋位置
        style: {
          url: "http://112.74.77.127:9100/hn/doulun_0322/doulun_0322.gltf",
          runAnimations: true,
          scale: 0.6
        },
        poup: '<p>我是斗轮</p>',
        tooltip: '<p>我是斗轮</p>',
        allowDrillPick: false,
      })
      graphicLayer.addGraphic(dou3)
 
      var dou4 = new mars3d.graphic.ModelEntity({
 
        position: [121.406729, 31.467183, 14], // 楼栋位置
        style: {
          url: "http://112.74.77.127:9100/hn/doulunji/zhuzhou/zhuzhou.gltf",
          heading: 0,
          scale: 0.6
        },
        drawShow: false,
        poup: '<p>我是斗轮</p>',
        tooltip: '<p>我是斗轮</p>',
        allowDrillPick: false,
      })
      graphicLayer.addGraphic(dou4)
 
 
      console.log(this.dou3, "dou3")
 
      var position_dou = new Cesium.CallbackProperty(function (time) {
        return dou3.position
      }, false)
      console.log(position_dou, "position_dou")
      var rectangularSensor = new mars3d.graphic.RectangularSensor({
        // position: [121.406729, 31.467183, 22],
        // position: new Cesium.CallbackProperty(function (time) {
        //   return dou3.position
        // }, false),
        position: position_dou,
        style: {
          heading: 29,
          pitch: 196,
          roll: 98,
 
          radius: 10, // 传感器的半径
          xHalfAngleDegree: 24, // 传感器水平半角
          yHalfAngleDegree: 55, // 传感器垂直半角
 
          color: "#00ffff",
          opacity: 0.4,
          lineColor: "#ffffff", // 线的颜色
 
          showSectorSegmentLines: false,
          showIntersection: false,
          showDomeSurfaces: false,
          showDomeLines: false,
          showLateralSurfaces: false,
          showScanPlane: true, // 是否显示扫描面
          scanPlaneColor: "#00ffff",
          scanPlaneOpacity: 0.9,
          scanPlaneMode: "vertical", // 扫描面模式 垂直vertical/水平horizontal
          scanPlaneRate: 3, // 扫描速率,
          depthTest: true
        }
      })
      graphicLayer.addGraphic(rectangularSensor)
 
 
 
      // 通过ID获取煤棚模型
      let other_wall_model = map.getLayer(0, "id");
      // let changqu_model = map.getLayer(1, "id");
      let dimian_model = map.getLayer(2, "id");
      let pati_madao_model = map.getLayer(3, "id");
      let tiejia_model = map.getLayer(4, "id");
      let qiang_ding_model = map.getLayer(5, "id");
 
 
 
 
      // 煤棚部分的显示与隐藏
      $("#meipeng").click(function () {
        //other_wall_model.show = true;
        pati_madao_model.show = true;
        dimian_model.show = true;
        tiejia_model.show = true;
        qiang_ding_model.show = true;
      });
 
      // 点击隐藏与显示厂区煤棚
      $("#meipeng_qiang_ding").click(function () {
        if (qiang_ding_model.show == false) {
          qiang_ding_model.show = true;
        } else {
          qiang_ding_model.show = false;
        }
      });
      $("#meipeng_pati_madao").click(function () {
        if (pati_madao_model.show == false) {
          pati_madao_model.show = true;
        } else {
          pati_madao_model.show = false;
        }
      });
      $("#meipeng_tiejia").click(function () {
        if (tiejia_model.show == false) {
          tiejia_model.show = true;
        } else {
          tiejia_model.show = false;
        }
      });
      $("#meipeng_dimian").click(function () {
        console.log(dimian_model);
        if (dimian_model.show == false) {
          dimian_model.show = true;
        } else {
          dimian_model.show = false;
        }
      });
 
      // 点击时间轴切换煤堆模型
      $(document).on('click', '.time_box', function (e) {
        e.stopPropagation();//阻止冒泡
        $("#meidui_message").empty()
        let time_ = e.target.nextSibling.nextSibling.textContent;
        let plan_box = ''
        $("#meidui_message").css({ display: 'block' });
        $.ajax({
          type: 'get',
          dataType: 'json',
          async: false,//同步
          headers: {
            "Access-Control-Allow-Origin": "*"
          },
          url: `${data_url}get_plan_by_time&index_=${time_}`,
          success: function (data) {
            console.log(data, "NO_data")
            if (data.data.length > 0) {
              plan_box = `
            <p class='p_text'><span class='span_text'>煤堆:</span>${data.data[0].plan_name}</p>
            <p class='p_text'><span class='span_text'>煤种:</span>${data.data[0].coal_marker}</p>
            <p class='p_text'><span class='span_text'>重量:</span>${data.data[0].coal_weight}吨</p>
            <p class='p_text'><span class='span_text'>体积:</span>${data.data[0].coal_volume}立方米</p>
            `
 
              $("#meidui_message").append(plan_box)
            } else {
              plan_box = '暂无数据'
              $("#meidui_message").append(plan_box)
            }
 
            let data_path = data.data[0].data_path
            if (pointPrimitives) {
              pointPrimitives.destroy(true)
            }
            $.ajax({
              url: data_path,
              dataType: 'text',
              success: function (data) {
                addPointCloud(data)
              }
            });
 
          },
          error: function (request, textStatus) {
          }
        })
 
      })
 
 
      // 请求数据库数据,对斗轮机模型进行操作
      $("#test_btn").click(function () {
        // openTimeBox()
        $("#test_btn").addClass("disable");
        console.log(dou_params)
        if (model_no < dou_params.length - 1) {
          model_no++
        } else {
          model_no = 0
        }
        let item = dou_params[model_no]
        dou_move(item.longitude, item.latitude, item.elevation, item.heading_angle)
 
        setTimeout(function () {
          $("#test_btn").removeClass("disable");
        }, 5000);
      })
 
 
      time_btn.click(function (e) {
        for (let i = 0; i < time_btn.length; i++) {
          console.log(time_btn[i].text)
        }
      })
      // 封装斗轮机工作移动方法
      function dou_move (lon, lat, h, heading_angle) {
        dou1.moveTo({
          position: [lon, lat, h]
        })
        dou2.moveTo({
          position: [lon, lat, h]
        })
        dou3.moveTo({
          position: [lon, lat, h]
        })
        dou4.moveTo({
          position: [lon, lat, h]
        })
        dou2.setStyle({
          heading: heading_angle
        })
        dou3.setStyle({
          heading: heading_angle
        })
        dou4.setStyle({
          heading: heading_angle
        })
      }
 
 
      // 斗轮机工作或暂停(对应斗轮机动画)
      $("#dou_work").click(function () {
        if (dou3.options.style.runAnimations == false) {
          dou3.setStyle({
            clampAnimations: false,
            runAnimations: true,
            direction: true,
            time: 5
          })
        } else {
          dou3.setStyle({
            clampAnimations: false,
            runAnimations: false,
            direction: true,
            time: 5
          })
        }
      })
 
 
 
      // 斗轮机旋转
      $("#dou_rote").click(function () {
        // 无动画效果的旋转
        dou_data.heading += 20
        dou2.setStyle({
          heading: dou_data.heading
        })
        dou3.setStyle({
          heading: dou_data.heading
        })
        dou4.setStyle({
          heading: dou_data.heading
        })
      })
 
      // 煤堆按钮  点击显示与隐藏时间轴和日历
      $("#point_btn").click(function () {
        $("#timeline").css({ display: 'none' })
        $(".search").toggle();
        console.log(search)
      })
 
 
      // 给功能按钮添加样式
      $(function () {
        $(".handle > button").click(function () {
          $("button[class='active']").removeAttr("class");
          $(this).addClass("active");
        });
      });
 
 
 
      // group方法可以将一个数组按照指定长度进行分组
      function group (array, subGroupLength) {
        let index = 0;
        let newArray = [];
        while (index < array.length) {
          newArray.push(array.slice(index, index += subGroupLength));
        }
        return newArray;
      }
 
      // 封装加载点云方法
      function addPointCloud (data) {
        // 申明点渲染集合
        pointPrimitives = map.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection());
        datas = data.split(/\s|[\r\n]/)//将txt每行内容根据空格和换行进行切割
        data_list = datas.map(Number)//将切割后的xyz左边转换为数字格式
        list = group(data_list, 3)//将转换后的数据每3个分为一组
        // 循环数组,加载点云
        for (var i = 0; i < list.length; i++) {
          // 真实参数
          // var hn_lon = Number(list[i][0]) / distance_half + 121.398442;
          // var hn_lat = Number(list[i][1]) / distance_half + 31.460107;
          // var hn_h = 300 - Number(list[i][2]);
          // 缩小煤堆所用参数
          var hn_lon = Number(list[i][0]) / 151319.5 + 121.405902;
          var hn_lat = Number(list[i][1]) / 151319.5 + 31.467607;
          var hn_h = 200 - Number(list[i][2]);
          var color_b = Math.floor(hn_h)
          if (hn_h <= 50) {
            color = Cesium.Color.fromCssColorString(`rgba(0, ${color_b}, ${color_b}, 1)`)
          } else if (hn_h <= 80) {
            color = Cesium.Color.fromCssColorString(`rgba(${color_b}, 0, ${color_b}, 1)`)
          } else {
            color = Cesium.Color.fromCssColorString(`rgba(${color_b}, ${color_b}, 0, 1)`)
          }
          var position = Cesium.Cartesian3.fromDegrees(hn_lon, hn_lat, hn_h);
          pointPrimitives.add({
            pixelSize: 1,
            color: color,
            //         outlineColor: Cesium.Color.BLUE,
            outlineWidth: 0,
            position: position
          });
 
        }
      }
 
 
 
 
      // 选择时间显示所选时间段的时间轴
      $(".search_time_btn").click(function () {
        $("#timeline").css({ display: 'block' })
        $("#timeline").empty()
        let time1 = $(".time1").val()
        let time2 = $(".time2").val()
        $.ajax({
          type: 'get',
          dataType: 'json',
          async: false,//同步
          headers: {
            "Access-Control-Allow-Origin": "*"
            // "Accept": "application/json"
          },
          url: `${data_url}get_point_by_time&time1=${time1}&time2=${time2}`,
          success: function (data) {
            console.log(data, "point_data")
            point_model = data.data
            var time_box_html = ''
            for (let i = 1; i < point_model.length + 1; i++) {
              time_box_html += `<span class="time_box"></span>
              <span class="message">${point_model[i - 1].createTime}</span>`
            }
            $("#timeline").append(time_box_html)
 
          },
          error: function (request, textStatus) {
 
          }
        })
      })
 
 
      $("#changqu_btn").click(function () {
        qiang_ding_model.show = true;
        pati_madao_model.show = true;
        tiejia_model.show = true;
        map.setCameraView({
          lat: 31.460107,
          lng: 121.398442,
          alt: 531.23,
          heading: 33,
          pitch: -23,
        });
      })
 
      $("#meipeng_btn").click(function () {
        qiang_ding_model.show = true;
        pati_madao_model.show = true;
        tiejia_model.show = true;
        map.setCameraView({
          lat: 31.462920,
          lng: 121.405911,
          alt: 210,
          heading: 356,
          pitch: -20,
        });
      })
 
      $("#pengnei_btn").click(function () {
 
        pati_madao_model.show = false;
        tiejia_model.show = false;
        map.setCameraView({
          lat: 31.466055,
          lng: 121.406275,
          alt: 40,
          heading: 7,
          pitch: -14,
        });
      })
 
 
      //键盘漫游
      map.keyboardRoam.setOptions({
        moveStep: 0.1, //平移步长 (米)。
        dirStep: 50, //相机原地旋转步长,值越大步长越小。
        rotateStep: 0.3, //相机围绕目标点旋转速率,0.3-2.0
        minPitch: 0.1, //最小仰角  0-1
        maxPitch: 0.95, //最大仰角  0-1
      });
      map.keyboardRoam.enabled = true; //开启键盘漫游
    }
 
 
 
 
  </script>
</body>
 
</html>