From 722473e2b2cd4776a65ba0b620a9710728963611 Mon Sep 17 00:00:00 2001
From: fuchengshen <men883234@gmail.com>
Date: 星期二, 14 六月 2022 10:24:52 +0800
Subject: [PATCH] 更改棚内和煤棚视角
---
public/hn3d/example/00_hn_new.html | 251 +++++++++++++++++++++++++++++++------------------
1 files changed, 159 insertions(+), 92 deletions(-)
diff --git a/public/hn3d/example/00_hn_new.html b/public/hn3d/example/00_hn_new.html
index ea5d358..b982cae 100644
--- a/public/hn3d/example/00_hn_new.html
+++ b/public/hn3d/example/00_hn_new.html
@@ -5,20 +5,13 @@
<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="author" content="鐏槦绉戞妧 http://mars3d.cn " />
+
<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" />
- <!-- 鏍囬鍙婃悳绱㈠叧閿瓧 -->
- <meta name="keywords" content="鐏槦绉戞妧,cesium,3D,GIS,marsgis,涓夌淮,鍦扮悆,鍦板浘,寮�鍙�,妗嗘灦,绯荤粺,绀轰緥,璧勬枡,妯″瀷,绂荤嚎,澶栧寘,鍚堣偉,瀹夊窘,涓浗" />
- <meta name="description"
- content="鐏槦绉戞妧 鍚堣偉鐏槦 鍚堣偉鐏槦绉戞妧 鍚堣偉鐏槦绉戞妧鏈夐檺鍏徃 leaflet leaflet妗嗘灦 leaflet寮�鍙� cesium cesium寮�鍙� cesium妗嗘灦 涓夌淮 鍦扮悆 妯″瀷 gis marsgis 鍦板浘绂荤嚎 鍦板浘寮�鍙� 鍦板浘妗嗘灦 鍦板浘澶栧寘 妗嗘灦 寮�鍙� 澶栧寘 鍦板浘绂荤嚎 浜岀淮鍦板浘 涓夌淮鍦板浘 鍏ㄦ櫙婕父 鍦扮悊淇℃伅绯荤粺 浜慓IS 涓夌淮GIS GIS骞冲彴 WebGIS" />
-
- <link rel="shortcut icon" type="image/x-icon" href="https://muyao1987.gitee.io/cdn/marsgis.cn/favicon/favicon.ico" />
- <title>鏁欏妤�(BIM寤烘ā) | Mars3D | 涓夌淮鍦板浘 | 鐏槦绉戞妧 | 鍚堣偉鐏槦绉戞妧鏈夐檺鍏徃</title>
<!--绗笁鏂筶ib-->
<script type="text/javascript" src="../lib/include-lib.js" libpath="../lib/"
@@ -88,9 +81,9 @@
<div class="infoview">
<div>
鍗庤兘鐭虫礊鍙d簩鍘傝瑙掞細
- <input type="button" class="btn btn-primary" value="鍘傚尯" onclick="centerAtDX1()" />
- <input type="button" class="btn btn-primary" value="鐓ゆ" onclick="centerAtDX2()" />
- <input type="button" class="btn btn-primary" value="妫氬唴" onclick="centerAtDX3()" />
+ <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>
<!-- 鎿嶄綔鎸夐挳鏍� -->
@@ -111,7 +104,7 @@
<!-- 鏃ュ巻閫夋嫨妗� -->
- <div class="search">
+ <div class="search" style="display: none;">
<div class="container">
<form action="" class="form-horizontal">
<fieldset>
@@ -134,6 +127,11 @@
</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>
@@ -185,30 +183,8 @@
}
})
- // $.ajax({
- // type: 'get',
- // dataType: 'json',
- // async: false,//鍚屾
- // headers: {
- // "Access-Control-Allow-Origin": "*"
- // // "Accept": "application/json"
- // },
- // url: `${data_url}get_point_cloud`,
- // success: function (data) {
- // console.log(data, "point_data")
- // point_model = data.data
- // var time_box_html = ''
- // for (let i = 1; i < point_model.length; i++) {
- // time_box_html += `<span class="time_box "></span>
- // <span class="message">${point_model[i].createTime}</span>`
- // }
- // $("#timeline").append(time_box_html)
- // },
- // error: function (request, textStatus) {
- // }
- // })
-
+ // 璁剧疆鏃ュ巻闈㈡澘鐨勬椂闂存牸寮忓拰璇█
$('.form_datetime').datetimepicker({
language: 'zh-CN', //璁剧疆涓轰腑鏂�
format: 'yyyy-mm-dd hh:ii:00', //璁剧疆鏃ユ湡鏍煎紡
@@ -222,6 +198,18 @@
});
})
+
+
+
+ $(document).on('click', function () {
+ console.log("ddd")
+ $("#meidui_message").css({ display: 'none' })//闅愯棌
+ });
+
+ $("#meidui_message").on('click', function (event) {
+ event.stopPropagation();//闃绘鍐掓场
+ })
+
// 鍒濆鍖栧湴鐞冨弬鏁�
function initMap (options) {
//鍚堝苟灞炴�у弬鏁帮紝鍙鐩朿onfig.json涓殑瀵瑰簲閰嶇疆
@@ -346,11 +334,29 @@
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, //榛樿涓洪紶鏍囩Щ鍏ラ珮浜紝涔熷彲浠ユ寚瀹歝lick鍗曞嚮楂樹寒
+ color: "rgba(255,255,255,0)",
+ },
+ popup: "all",
+ show: true,
+ scale: 20,
}
],
});
-
- // addCustomLayers()
//鍒涘缓涓夌淮鍦扮悆鍦烘櫙
@@ -363,12 +369,9 @@
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",
@@ -387,6 +390,9 @@
// 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)
@@ -398,7 +404,9 @@
runAnimations: true,
scale: 0.6
},
- parent: dou_parent
+ poup: '<p>鎴戞槸鏂楄疆</p>',
+ tooltip: '<p>鎴戞槸鏂楄疆</p>',
+ allowDrillPick: false,
})
graphicLayer.addGraphic(dou3)
@@ -410,8 +418,53 @@
heading: 0,
scale: 0.6
},
+ drawShow: false,
+ poup: '<p>鎴戞槸鏂楄疆</p>',
+ tooltip: '<p>鎴戞槸鏂楄疆</p>',
+ allowDrillPick: false,
})
graphicLayer.addGraphic(dou4)
+
+
+ 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
+ },
+ // parent: dou3
+ })
+ graphicLayer.addGraphic(rectangularSensor)
+
// 閫氳繃ID鑾峰彇鐓ゆ妯″瀷
@@ -433,6 +486,8 @@
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;
@@ -465,21 +520,35 @@
// 鐐瑰嚮鏃堕棿杞村垏鎹㈢叅鍫嗘ā鍨�
$(document).on('click', '.time_box', function (e) {
- console.log(e.target.nextSibling.nextSibling.textContent, "鐐瑰嚮")
+ e.stopPropagation();//闃绘鍐掓场
+ $("#meidui_message").empty()
let time_ = e.target.nextSibling.nextSibling.textContent;
- // var index_ = $("#timeline .time_box").index(this);
- // console.log(index_)
+ let plan_box = ''
+ $("#meidui_message").css({ display: 'block' });
$.ajax({
type: 'get',
dataType: 'json',
async: false,//鍚屾
headers: {
"Access-Control-Allow-Origin": "*"
- // "Accept": "application/json"
},
- url: `${data_url}get_point_cloud_NO&index_=${time_}`,
+ 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)
@@ -491,9 +560,9 @@
addPointCloud(data)
}
});
+
},
error: function (request, textStatus) {
-
}
})
@@ -571,10 +640,6 @@
-
-
-
-
// 鏂楄疆鏈烘棆杞�
$("#dou_rote").click(function () {
// 鏃犲姩鐢绘晥鏋滅殑鏃嬭浆
@@ -590,13 +655,15 @@
})
})
- // 鐓ゅ爢鎸夐挳
+ // 鐓ゅ爢鎸夐挳 鐐瑰嚮鏄剧ず涓庨殣钘忔椂闂磋酱鍜屾棩鍘�
$("#point_btn").click(function () {
$("#timeline").css({ display: 'none' })
$(".search").toggle();
console.log(search)
})
+
+ // 缁欏姛鑳芥寜閽坊鍔犳牱寮�
$(function () {
$(".handle > button").click(function () {
$("button[class='active']").removeAttr("class");
@@ -622,13 +689,14 @@
pointPrimitives = map.viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection());
datas = data.split(/\s|[\r\n]/)//灏唗xt姣忚鍐呭鏍规嵁绌烘牸鍜屾崲琛岃繘琛屽垏鍓�
data_list = datas.map(Number)//灏嗗垏鍓插悗鐨剎yz宸﹁竟杞崲涓烘暟瀛楁牸寮�
- list = group(data_list, 3)//灏嗚浆鎹㈠悗鐨勬暟鎹瘡鍏釜鍒嗕负涓�缁�
+ 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]);
@@ -655,7 +723,7 @@
- // 鎵撳紑
+ // 閫夋嫨鏃堕棿鏄剧ず鎵�閫夋椂闂存鐨勬椂闂磋酱
$(".search_time_btn").click(function () {
$("#timeline").css({ display: 'block' })
$("#timeline").empty()
@@ -688,11 +756,44 @@
})
+ $("#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,
+ });
+ })
//閿洏婕父
@@ -708,40 +809,6 @@
-
-
-
-
-
- function centerAtDX1 () {
- map.setCameraView({
- lat: 31.460107,
- lng: 121.398442,
- alt: 531.23,
- heading: 33,
- pitch: -23,
- });
- }
-
- function centerAtDX2 () {
- map.setCameraView({
- lat: 31.464903,
- lng: 121.404337,
- alt: 210,
- heading: 32,
- pitch: -20,
- });
- }
-
- function centerAtDX3 () {
- map.setCameraView({
- lat: 31.466355,
- lng: 121.405475,
- alt: 159,
- heading: 2,
- pitch: -18,
- });
- }
</script>
</body>
--
Gitblit v1.9.1