-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmap - 副本.html
693 lines (630 loc) · 33.4 KB
/
map - 副本.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>webgis三维综合版</title>
<script type="text/javascript" src="js/jquery/jquery-1.9.1.min.js"></script>
<!-- drawhelper样式 -->
<link href="Content/DrawHelper.css" rel="stylesheet" type="text/css" />
<!-- 下方黑色显示坐标样式 -->
<link href="Content/cesiumviewer.css" rel="stylesheet" type="text/css" />
<link href="Content/map/map-index.css" rel="stylesheet" type="text/css" />
<link href="Content/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="Content/site.css" rel="stylesheet" type="text/css" />
<!-- 目录树样式 -->
<link rel="stylesheet" href="Content/zTreeStyle.css" type="text/css">
<!-- 飞行漫游样式 -->
<link rel="stylesheet" href="Content/fly3dPath.css" type="text/css">
<!-- 自定义tooltip样式 -->
<link href="Content/Tools-Tooltip-div.css" rel="stylesheet" type="text/css" />
<!-- 自定义window样式 -->
<link href="Content/Tools-Window-div.css" rel="stylesheet" type="text/css" />
<link href="js/main/cesium-api-1.42/Widgets/widgets.css" rel="stylesheet" type="text/css" />
<script src="js/main/cesium-api-1.42/Cesium.js"></script>
<!-- 开源绘图工具 -->
<script src="js/main/DrawHelper.js"></script>
<!-- 经过修改可进行贴地绘制图形工具 -->
<script src="js/Tools-DynamicDraw-ClampGround.js"></script>
<script src="js/Tools-Tooltip-div.js"></script>
<!-- 指南针 -->
<script src="js/main/viewerCesiumNavigationMixin.js"></script>
<!-- 量算 -->
<script src="js/main/measure.js"></script>
<!-- 飞行漫游 -->
<script type="text/javascript" src="js/main/map.map2dPanel.js"></script>
<script type="text/javascript" src="js/main/flycesium.js"></script>
<!--对话框-->
<link rel='stylesheet' href='js/plugins/jqueryDialog/jDialog/jDialog.css' />
<script src='js/plugins/jqueryDialog/jDialog.js' type='text/javascript'></script>
<!--ztree-->
<script type="text/javascript" src="js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="js/jquery.ztree.excheck.js"></script>
<style>
/*绘制工具Draw样式*/
.cesium_toolbar {
position: absolute;
top: 30%;
right: 18%;
display: inline;
background: #0f161c;
z-index: 999;
}
.mapfootBottom {
width: 100%;
height: 30px;
background: rgba(0,0,0,0.5);
position: absolute;
bottom: 0px;
cursor: default;
display:none;
}
</style>
</head>
<body>
<!--分享窗口-->
<div class="modal-content" id="modal-content" >
<div class="modal-header2" id="modal-header">
<p style="width:80%;position:absolute;left:2%;top:0%;margin:3px;">分享</p>
<img src="img/close.png" id="shareBtn" style="width:20px;height:20px;position:absolute;float:right;top:5px;right:10px;"/>
</div>
<div class="share-body" id="share-body">
<div class="share-line" id="share-line" style="height:20%;">
<p style="font-size:14px;margin:5px 10px;width:15%;position:absolute;float:left;">链接地址:</p>
<div class="input-text" id="input-text">
<input type="text" class="form-control" id="input_dlink" value="http://xx.xxx.xxx.xxx:8080/dataApp/cesiumProject/map.html">
</div>
<div class="input-btn" id="input-btn">
<button type="button" clas="btn btn-default btn-xs" id="copyBtn" style="height:100%;blackground-color:blue;">复制链接</button>
</div>
</div>
<div class="share-line" id="share-line2"style="height:60%;">
<p style="font-size:14px;margin:5px 10px;width:15%;position:absolute;float:left;">分享到:</p>
<div class="share-ma" id="share-ma">
<img src="img/2.png" style="width:120px;height:120px;"/>
</div>
</div>
</div>
</div>
<!--图层管理弹出提示-->
<!--dom弹出提示-->
<div class="intro-box" id="dom-warning" style="width:25%;height:15%;left:40%" >
<div class="top-container" id="top-container"> <!--放文字以及x的图标-->
<p style="width:90%;height:100%;margin:0px 0px 0px 20px;padding:0px;text-align:left;">注意</p>
<img src="img/close.png" id="domWarnBtn" style="width:20px;height:20px;position:absolute;float:right;top:10px;right:10px;"/>
</div>
<div class="intro-text" id="intro-text">
<p style="width:80%;height:20%;margin:0px 0px 0px 20px;padding:0px;text-align:left;font-size:13px;position:absolute;top:50%;">
dom为默认加载项,无法取消加载!
</p>
</div>
</div>
<!--自生产地形提示-->
<div class="intro-box" id="dem-warning" style="width:25%;height:15%;left:40%" >
<div class="top-container" id="top-container"> <!--放文字以及x的图标-->
<p style="width:90%;height:100%;margin:0px 0px 0px 20px;padding:0px;text-align:left;">注意</p>
<img src="img/close.png" id="demWarnBtn" style="width:20px;height:20px;position:absolute;float:right;top:10px;right:10px;"/>
</div>
<div class="intro-text" id="intro-text">
<p style="width:80%;height:20%;margin:0px 0px 0px 20px;padding:0px;text-align:left;font-size:13px;position:absolute;top:50%;">
自生产地形为默认加载项,无法取消加载!
</p>
</div>
</div>
<!--全球地形警告-->
<div class="intro-box" id="world-warning" style="width:25%;height:15%;left:40%" >
<div class="top-container" id="top-container"> <!--放文字以及x的图标-->
<p style="width:90%;height:100%;margin:0px 0px 0px 20px;padding:0px;text-align:left;">注意</p>
<img src="img/close.png" id="worldWarnBtn" style="width:20px;height:20px;position:absolute;float:right;top:10px;right:10px;"/>
</div>
<div class="intro-text" id="intro-text">
<p style="width:80%;height:20%;margin:0px 0px 0px 20px;padding:0px;text-align:left;font-size:13px;position:absolute;top:50%;">
加载世界地形将覆盖自生产地形无法复原,请注意!要重新加载自生产地形请刷新。
</p>
</div>
</div>
<!--载入中提示mask-->
<div class="signmask" id="mask-load" style="display:block;">
<div class="p-container" id="p-container">
<p style="font-size:20px;font-weight:bold;">真实的3d体验,掌握在你手中</p>
</div>
<div class="pic-container" id="pic-container">
<img id="turn-left" src="img/turn-left.png" style="width:20px;height:20px;margin:10px;"/>
<img id="mouse-left" src="img/left.png" style="width:30px;height:40px;"/>
<img id="mouse-middle" src="img/middle.png" style="width:30px;height:40px;"/>
<img id="mouse-right" src="img/right.png" style="width:30px;height:40px;"/>
<img id="turn-right" src="img/turn-right.png" style="width:20px;height:20px;margin:10px;"/>
<p style="font-size:15px;margin:20px;">左键平移,中键旋转,右键缩放</p>
</div>
</div>
<div class="signmask" id="mask-load2" style="display:none;">
<div class="p-container" id="p-container">
<p style="font-size:20px;font-weight:bold;">真实的3d体验,掌握在你手中</p>
</div>
<div class="pic-container" id="pic-container2">
<img id="turn-left2" src="img/turn-left.png" style="width:20px;height:20px;margin:10px;"/>
<img id="mouse-left2" src="img/left.png" style="width:30px;height:40px;"/>
<img id="mouse-middle2" src="img/middle.png" style="width:30px;height:40px;"/>
<img id="mouse-right2" src="img/right.png" style="width:30px;height:40px;"/>
<img id="turn-right2" src="img/turn-right.png" style="width:20px;height:20px;margin:10px;"/>
<p style="font-size:15px;margin:20px;">左键平移,中键旋转,右键缩放</p>
</div>
</div>
<!--三维地球开始-->
<div class="main-container" id="main-container">
<div class="main-content">
<div class="bigChooser" id="big">
</div>
<div class="floodChooser" id="flood-sim-window"style="height:200px;width:200px;top:70%;">
<img id="flood-close" src="img/close.png" style="width:15px;height:15px;position:absolute;right:5px;"/>
<form style="width:180px;height:50px;position:absolute;top:20%;">
淹没高度:
<input type="text" id="water-height" style="width:70px;" value="2000" />
m
</form>
<form style="width:180px;height:50px;position:absolute;top:35%;">
淹没速度:
<input type="text" id="water-speed" style="width:70px;" value="100" />
m/s
<p style="font-size:10px;color:#0ce665;margin:5px;">注意,该地区最低海拔为1400m,输入的数值为淹没平面高程且必须大于1400m。</p>
</form>
<button id="flood-sim-btn" class="btn btn-default btn-xs" style="color:#fff;background-color:#fff0;float:left; position:absolute; left:20px;bottom:15px;" onclick="alertValue()">开始模拟</button>
<button id="flood-stop-btn" class="btn btn-default btn-xs" style="color:#fff;background-color:#fff0;float:left; position:absolute; left:100px;bottom:15px;">退出模拟</button>
</div>
<!--模拟结束弹出提示-->
<div id="flood-result" style="display:none;background-color:#00000042;color:white;position:absolute;width:320px;height:50px;float:left;left:45%;top:15%;z-index:9999;">
<p style="text-align:center;margin:10px;">水淹模拟结束!请点击退出模拟按钮退出!</p>
<img id="result-close" src="img/close.png" style="width:15px;height:15px;position:absolute;right:5px;top:15px;"/>
</div>
<!-- 贴地画图工具条 -->
<div id="draw-control" class="cesium_toolbar" style="top:20%;right:8%;display:none;">
<div class="drawtoolbar">
<div class="button" title="添加标记" onclick="drawPoint()">
<span>
<img src="img/mark.png">
</span>
</div>
</div>
<div class="drawtoolbar">
<div class="button" title="画线" onclick="drawPolyline()">
<span>
<img src="img/polyline.png">
</span>
</div>
</div>
<div class="drawtoolbar">
<div class="button" title="画面" onclick="drawPolygon()">
<span>
<img src="img/polygon.png">
</span>
</div>
</div>
<div class="drawtoolbar">
<div class="button" title="清除图形" onclick="drawRemove()">
<span>
<img src="img/clear.png">
</span>
</div>
</div>
</div>
<!-- 通视分析 -->
<div id="visible-control" class="cesium_toolbar" style="top:20%;right:28%;display:none;">
<div class="drawtoolbar">
<div class="button" title="画线" onclick="drawVisiblePolyline()">
<span>
<img src="img/polyline.png">
</span>
</div>
</div>
<div class="drawtoolbar">
<div class="button" title="清除图形" onclick="drawRemove()">
<span>
<img src="img/clear.png">
</span>
</div>
</div>
</div>
<!--图层管理ztree-->
<div class="zTreeDemoBackground" id="zTreeContainer" style="left:3%;">
<ul id="treeDemo" class="ztree"></ul>
</div>
<!--渲染窗口-->
<div class="zTreeDemoBackground" id="effectOnMap" style="left:3%;height:150px;top:70%;">
<div class="layerClose" id="layerClose">
<img id="tool-close" src="img/close.png" style="width:15px;height:15px;position:absolute;right:5px;"/>
</div>
<div class="layerChooser" id="pointcloudSelect" >
点云效果: <br/>
<select id="pointcloudLayerSelect">
<option id="op1" selected="selected" value='2' style="color:black">若有若无</option> <!--默认选中-->
<option id="op2" value='3' style="color:black">虚无缥缈</option>
<option id="op3" value='4' style="color:black">经典写实</option>
<option id="op4" value='5' style="color:black">梦幻油画</option>
</select>
</div>
<div class="layerChooser" id="shaderEffect" style="top:100px;">
<input type="checkbox" id="shadow" style="margin:5px;">开启阴影<br />
</div>
</div>
<!-- 点云渲染窗口 -->
<div class="classColor" id="colorClassify">
地面:<input type="color" id="ground" value="#b37c4d" style="position:absolute; left:180px;"><br />
低矮植被:<input type="color" id="lowVegetation" value="#7FFF00" style="position:absolute; left:180px;"><br />
中高灌木:<input type="color" id="mediumVegetation" value="#00CD66" style="position:absolute; left:180px;"><br />
高大乔木:<input type="color" id="highVegetation" value="#008B00" style="position:absolute; left:180px;"><br />
建筑物:<input type="color" id="building" value="#FFFF00" style="position:absolute; left:180px;"><br />
水体:<input type="color" id="water" value="#0000FF" style="position:absolute; left:180px;"><br />
铁路:<input type="color" id="railway" value="#FF8247" style="position:absolute; left:180px;"><br />
公路:<input type="color" id="road" value="#CD0000" style="position:absolute; left:180px;"><br />
overlap:<input type="color" id="overlap" value="#FF00FF" style="position:absolute; left:180px;"><br />
钢丝护网:<input type="color" id="wireGuard" value="#FFFAFA" style="position:absolute; left:180px;"><br />
钢丝引导器:<input type="color" id="wireConductor" value="#FFFAFA" style="position:absolute; left:180px;"><br />
输电杆塔:<input type="color" id="tramsimissonTower" value="#FFFAFA" style="position:absolute; left:180px;"><br />
导线结构连接器:<input type="color" id="wireSturctureConnerctor" value="#FFFAFA" style="position:absolute; left:180px;"><br />
桥梁:<input type="color" id="bridge" value="#9932CC" style="position:absolute; left:180px;"><br />
未分类:<input type="color" id="unclassified" value="#8B8989" style="position:absolute; left:180px;"><br />
low point(noise):<input type="color" id="lowPoint" value="#b37c4d" style="position:absolute; left:180px;"><br />
high point(noise):<input type="color" id="hightPoint" value="#b37c4d" style="position:absolute; left:180px;"><br />
model key-point:<input type="color" id="keyPoint" value="#b37c4d" style="position:absolute; left:180px;"><br />
<input type="button" class="myButton" id="colorApply" value="应用" style="position:absolute;bottom:10px; left:40px;color:white;width:60px;font-size:16px;height:40px;">
<input type="button" class="myButton" id="colorClose" value="关闭" style="position:absolute;bottom:10px; left:200px;color:white;width:60px;font-size:16px;height:40px;">
<input type="button" class="myButton" id="undoClassify" value="还原" style="position:absolute;bottom:10px; left:120px;color:white;width:60px;font-size:16px;height:40px;">
</div>
<!-- 三维飞行 -->
<!--三维飞行漫游菜单界面-->
<div class="allrttop" id="tool_container" style="display:none;"></div>
<div class="allright" id="content" style="position:relative;">
<!--<div class="allrttop" id="tool_container"></div>-->
<div id="centerPanel">
<div id="map" class="mapone">
</div>
<div class="fly3DPaths" id="fly3DPaths">
<div class="fly3DPaths_title">操作菜单</div>
<!--新增-->
<!-- tab导航部分 -->
<div class='fly3DPaths_tab'>
<ul style='margin-left:0px;' class="fly3DPaths_tab_ul">
<li id='overFlyClick' class="select"><span><span class='flss'></span><a href='javascript:void(0)'>预设路线</a></span></li>
<li id='drawFlyCilck'><span><span class='flss'></span><a href='javascript:void(0);'>手动绘制</a></span></li>
</ul>
</div>
<!-- tab内容部分 -->
<!-- 预设路线 -->
<div id='overFlyPage' style='height: 100%;'>
<div style="padding: 5px;margin-top: 5px;">
<div class='ydph-table-wrap'>
<div class='ydph-talbe-head'>
<table id='overFly_table' class='table table-bordered'>
<thead>
<tr>
<!--<th class='colspan1'><input type='checkbox' onchange=''/></th>-->
<th class='colspan4'>名称</th>
<th class='colspan2'>操作</th>
<th class='colspan2'>修改</th>
<th class='colspan2'>删除</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
<!-- 手动绘制 -->
<div id='drawFlyPage' style='height: 100%; display:none'>
<div class="fly3DPaths_content">
<input id="start_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="开始飞行">
<input id="pause_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="暂停飞行">
<input id="playForward_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="向前飞行">
<input id="playReverse_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="向后飞行">
<input id="draw_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="设定路线">
<input id="save_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="保存路线">
<input id="clear_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="清空路线">
<input id="stop_Fly3DPaths" class="fly3DPaths_model_id" type="button" value="退出飞行">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 存放logo -->
<div class="logoContainer" id="logoContainer">
<img src="img/logo.png" style="width:100%;border-radius:5px;"/>
</div>
<!--div class="smallChooser" id="small">
<legend>调整模型偏差</legend>
x:<input type="text" id="xlayer" value="10"/><br/>
y:<input type="text" id="ylayer" value="10"/><br/>
z:<input type="text" id="zlayer" value="50"/><br/>
<input type="button" id="btn1" value="变换">
<input type="button" id="btn2" value="pick points">
<input type="button" id="btn3" value="重置">
<input type="button" id="btn4" value="measureDistance">
<input type="button" id="btn5" value="celiang">
</div-->
<div class="info-display" id="info-window1">
<img style="max-width:500px;height:300px;" src="img/travel/yelanghu1.jpg">
<img style="max-width:500px;height:300px;" src="img/travel/yelanghu2.jpg">
</div>
<!-- 上方工具条 -->
<div class="switch-box" id="switch-box" style="display:block;">
<!-- 隐藏时 -->
<div class="topbar-left" id="topbar-left">
<div class="bar-item menu-switch" id="menu-switch" data-type="7">
<img src="img/menu.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">图层<span>
</div>
<!-- 右箭头点击展开 -->
<div class="bar-item menu-switch" id="hide-switch" data-type="8" style="display:block;width:50%;">
<img src="img/display.png" style="width:25px;height:25px;margin:15px;"/>
</div>
</div>
<!-- 已展开工具条 -->
<div class="topbar-right" id="topbar-right" style="display:none;">
<div class="bar-item tool-switch" id="tool-switch" data-type="1">
<img src="img/effect.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">效果<span>
</div>
<div class="bar-item tool-switch" id="shader-switch" data-type="10">
<img src="img/shader.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">渲染<span>
</div>
<div class="bar-item opera-switch" id="draw-switch" data-type="5">
<img src="img/draw.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">绘图<span>
</div>
<div class="bar-item opera-switch" id="clamp-switch" data-type="11">
<img src="img/clamp.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">贴地绘图<span>
</div>
<div class="bar-item opera-switch" id="visible-switch" data-type="12">
<img src="img/eye.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">通视分析<span>
</div>
<div class="bar-item opera-switch" id="flood-switch" data-type="6">
<img src="img/flood_sim.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">洪水<span>
</div>
<div class="bar-item opera-switch" id="measure-switch" data-type="8">
<img src="img/measure.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">量测<span>
</div>
<div class="bar-item opera-switch" id="plane-switch" data-type="9">
<img src="img/fly.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">飞行<span>
</div>
<!--div class="bar-item info-switch" id="info-switch" data-type="2">
<img src="img/infomation.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">帮助<span>
</div-->
<div class="bar-item share-switch" id="share-switch" data-type="3">
<img src="img/share.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/>
<span style="color:white;">分享<span>
</div>
<!-- <div class="bar-item opera-switch" id="opera-switch" data-type="4"> -->
<!-- <img src="img/mouse.png" style="display:block;width:25px;height:25px;margin:0 auto 7px;"/> -->
<!-- <span style="color:white;">引导<span> -->
<!-- </div> -->
<!-- 左箭头点击隐藏 -->
<div class="bar-item opera-switch" id="display-switch" data-type="4">
<img src="img/hide.png" style="display:block;width:25px;height:25px;margin:15px;"/>
</div>
</div>
</div>
</div>
<script type="text/javascript">
//以及点击其他位置隐藏帮助的弹出框
var viewer = new Cesium.Viewer('map', {
baseLayerPicker:false,
imageryProvider : new Cesium.WebMapTileServiceImageryProvider({
url : 'http://t0.tianditu.com/img_w/wmts',
layer : 'img',
style : 'default',
format : 'tiles',
tileMatrixSetID : 'w',
credit : new Cesium.Credit('天地图全球影像服务'),
maximumLevel : 18
}),
animation: false, //动画控制,默认true
geocoder: false,//地名查找,默认true
timeline: false,//时间线,默认true
//terrainShadows: Cesium.ShadowMode.ENABLED,
//shadows:true,//阴影
//terrainShadows:Cesium.ShadowMode.ENABLED,
homeButton: true,//主页按钮,默认true
fullscreenButton: false,//全屏按钮,默认显示true
infoBox: true,//点击要素之后显示的信息,默认true
//requestRenderMode : true,
maximumRenderTimeChange : 1,
navigationHelpButton: false,//导航帮助说明,默认true
navigationInstructionsInitiallyVisible: false,
});
//viewer.scene.debugShowFramesPerSecond = true;
//viewer.clock.shouldAnimate = true;
//viewer.scene.targetFrameRate = 100;
//viewer.scene.requestRender();
//viewer.extend(Cesium.viewerCesiumInspectorMixin); inspector
var globe = viewer.scene.globe;
//globe.enableLighting = true;
viewer.scene.fog.enable = true;
// Bounding sphere这个就是让镜头靠近的Home键
var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(105.71504, 26.37208, 5.8068678), 1500.5595102);
// Override behavior of home button
viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function (commandInfo) {
// Fly to custom position
viewer.camera.flyToBoundingSphere(boundingSphere);
// Tell the home button not to do anything
commandInfo.cancel = true;
});
// Set custom initial position
viewer.camera.flyToBoundingSphere(boundingSphere, { maximumHeight: 5 });
//跳转
viewer.camera.flyTo({//初始化跳转某个地方
destination: Cesium.Cartesian3.fromDegrees(105.71504, 26.37208, 1500),
orientation:{"heading":-10,"pitch":-0.21097267398444197,"roll":0}
});
//加载地形图
var rectangle = new Cesium.Rectangle(Cesium.Math.toRadians(105.6721079389645), Cesium.Math.toRadians(26.33429489408063),
Cesium.Math.toRadians(105.75062034790945), Cesium.Math.toRadians(26.405558098559784));
var terrainLayer = new Cesium.CesiumTerrainProvider({
url: 'img/0807',//'http://localhost:9002/api/wmts/terrain/ea29219ab0ef41a5b048878c3838c8cc', //'1-8-2',
requestWaterMask: true
});
viewer.terrainProvider = terrainLayer;
viewer.scene.globe.depthTestAgainstTerrain = true; //开启地形深度检测
viewer.scene.globe.enableLighting = true; //允许光照
//隐藏cesiumlogo
viewer._cesiumWidget._creditContainer.style.display = "none";
//数据加载完就隐藏开始的那个div
window.onload=function(){
$("#mask-load").hide();
var material = getElevationContourMaterial(1200);
globe.material = material;
};
//显示当前坐标
function show3DCoordinates() {
//地图底部工具栏显示地图坐标信息
var elementbottom = document.createElement("div");
$(".cesium-viewer").append(elementbottom);
elementbottom.className = "mapfootBottom";
var coordinatesDiv = document.getElementById("map_coordinates");
if (coordinatesDiv) {
coordinatesDiv.style.display = "block";
}
else {
//var scale;
var _divID_coordinates = "map_coordinates";
coordinatesDiv = document.createElement("div");
coordinatesDiv.id = _divID_coordinates;
coordinatesDiv.className = "map3D-coordinates";
//coordinatesDiv.innerHTML = "<span id='cd_label' style='font-size:13px;text-align:center;font-family:微软雅黑;color:#edffff;'>暂无坐标信息</span>";
$(".cesium-viewer").append(coordinatesDiv);
var handler3D = new Cesium.ScreenSpaceEventHandler(
viewer.scene.canvas);
handler3D.setInputAction(function (movement) {
var pick = new Cesium.Cartesian2(movement.endPosition.x, movement.endPosition.y);
if (pick) {
var cartesian = viewer.scene.globe.pick(viewer.camera.getPickRay(pick), viewer.scene);
if (cartesian) {
//世界坐标转地理坐标(弧度)
var cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
if (cartographic) {
//海拔
var height = viewer.scene.globe.getHeight(cartographic);
//视角海拔高度
var he = Math.sqrt(viewer.scene.camera.positionWC.x * viewer.scene.camera.positionWC.x + viewer.scene.camera.positionWC.y * viewer.scene.camera.positionWC.y + viewer.scene.camera.positionWC.z * viewer.scene.camera.positionWC.z);
var he2 = Math.sqrt(cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z);
//地理坐标(弧度)转经纬度坐标
var point = [cartographic.longitude / Math.PI * 180, cartographic.latitude / Math.PI * 180];
if (!height) {
height = 0;
}
if (!he) {
he = 0;
}
if (!he2) {
he2 = 0;
}
if (!point) {
point = [0, 0];
}
coordinatesDiv.innerHTML = "<span id='cd_label' style='font-size:13px;text-align:center;font-family:微软雅黑;color:#edffff;'>" + "视角海拔高度:" + (he - he2).toFixed(2) + "米" + " 海拔:" + height.toFixed(2) + "米" + " 经度:" + point[0].toFixed(6) + " 纬度:" + point[1].toFixed(6) + "</span>";
}
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
}
}
show3DCoordinates();
//添加导航控件
viewer.extend(Cesium.viewerCesiumNavigationMixin, {});
var navi = document.getElementById('distanceLegendDiv');
navi.style.position = 'absolute';
//navi.style.z-index = '999';
navi.style.left = '70%';
navi.style.top = '1%';
//显示地图工具栏
DCI.map2dTool.InitTool(viewer);
//量算工具
var html = '<div id="toolTip" class="measure-mouse-tip" style="display:none;color:rgb(236, 159, 30);border: 1px solid rgb(236, 159, 30);position:absolute;font-size:12px;color:#fff">单击开始,双击结束</div>';
$('.cesium-viewer').append(html);
//绘制工具Drawhelper
var html = '<div id="toolbar" class="cesium_toolbar"></div>';
$('.cesium-viewer').append(html);
var drawHelper = new DrawHelper(viewer);
var toolbar = drawHelper.addToolbar(document.getElementById("toolbar"), {
buttons: ['marker', 'polyline', 'polygon', 'circle', 'extent']
});
var getToolbar = document.getElementById("toolbar");
getToolbar.style.display='none';//生成toolbar时先设定不能被看见,要点击那个按钮才可以
//点
toolbar.addListener('markerCreated', function (event) {
var b = new Cesium.BillboardCollection();
viewer.scene.primitives.add(b);
var billboard = b.add({
show: true,
id: "plot",
position: event.position,
pixelOffset: new Cesium.Cartesian2(0, 0),
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, 0.0),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.CENTER,
scale: 1.0,
image: 'Content/images/glyphicons_242_google_maps.png',
color: new Cesium.Color(1.0, 1.0, 1.0, 1.0)
});
billboard.setEditable();
});
//线
toolbar.addListener('polylineCreated', function (event) {
var polyline = new DrawHelper.PolylinePrimitive({
positions: event.positions,
width: 5,
type: "plot",
geodesic: true
});
viewer.scene.primitives.add(polyline);
polyline.setEditable();
});
//面
toolbar.addListener('polygonCreated', function (event) {
var polygon = new DrawHelper.PolygonPrimitive({
positions: event.positions,
type: "plot",
material: Cesium.Material.fromType('Checkerboard')
});
viewer.scene.primitives.add(polygon);
polygon.setEditable();
});
//圆形
toolbar.addListener('circleCreated', function (event) {
var circle = new DrawHelper.CirclePrimitive({
center: event.center,
radius: event.radius,
type: "plot",
material: Cesium.Material.fromType(Cesium.Material.RimLightingType)
});
viewer.scene.primitives.add(circle);
circle.setEditable();
});
//矩形
toolbar.addListener('extentCreated', function (event) {
var extent = event.extent;
var extentPrimitive = new DrawHelper.ExtentPrimitive({
extent: extent,
type: "plot",
material: Cesium.Material.fromType(Cesium.Material.StripeType)
});
viewer.scene.primitives.add(extentPrimitive);
extentPrimitive.setEditable();
});
//三维飞行初始化
bxmap.FlyCesium.Init(viewer, drawHelper);//初始化漫游飞行路径功能
</script>
<script src="js/drawClampGround.js"></script>
<script src="js/ztreeIni.js"></script>
<script src="js/layerLoad.js"></script>
<script src="js/windowControl.js"></script>
<script src="js/tool.js"></script>
</body>
</html>