@@ -390,6 +458,15 @@
name: "supermap3D",
data() {
return {
+ imgData: [
+ {
+ img: require("./../../../static/img/1.png"),
+ },
+ {
+ img: require("./../../../static/img/2.png"),
+ },
+ ],
+
currentMark:"",
peoplename: "石付军",
suoshuhedao: "浉河",
@@ -557,6 +634,48 @@
window.earth = viewer;
+ //加载人员轨迹接口
+ // type:(1 河道 /2 管网 /"" 所有 )
+ var params = { "data": { "type": "" } }
+ this.$http.post(this.nozzle.recordSelectAllPoints, params).then(res => {
+ if (res.data.code == 200) {
+ this.MonitorStationRY=[]
+
+
+ var celllist=res.data.data
+ for(var i=0;i {
- var position = new Cesium.Cartographic(lon, lat, 0);
- this.fixDomPosition(keyid, position);
- });
+ console.log(111111111111,lon)
+ console.log(2222222222222,lat)
+
+ break;
+ }
+ }
+
+
+ document.getElementById(
+ keyid
+ ).style.display = "block";
+
+ window.earth.scene.preRender.addEventListener(() => {
+ var position = new Cesium.Cartographic(
+ parseFloat(lon),
+ parseFloat(lat),
+ 0
+ );
+ this.fixDomPosition(keyid, position);
+ });
+
+
+
+
+ // document.getElementById(keyid).style.display = "block";
+
+ // window.earth.scene.preRender.addEventListener(() => {
+ // var position = new Cesium.Cartographic(lon, lat, 0);
+ // console.log("lon",lon)
+ // console.log("lat",lat)
+ // console.log("keyid",keyid)
+ // this.fixDomPosition(keyid, position);
+ // });
},
clearPopup(event) {
var clickDom = event.currentTarget;
@@ -1299,6 +1459,9 @@
this.fixDomPosition(pickedFeature.id.id, position);
});
} else if (pickedFeature.id.type == "人员") {
+
+ this.peoplename = pickedFeature.id.id
+
document.getElementById(
pickedFeature.id.id
).style.display = "block";
@@ -1630,13 +1793,15 @@
console.log("this.MonitorStationBZ", this.MonitorStationBZ);
console.log("this.MonitorStationZZ", this.MonitorStationZZ);
- //人员
- this.MonitorStationRY = this.dataliststation.filter(function (item) {
- return item.type == "人员";
- });
- this.addPoint(this.MonitorStationRY);
+ // //人员
+ // this.MonitorStationRY = this.dataliststation.filter(function (item) {
+ // return item.type == "人员";
+ // });
+ // this.addPoint(this.MonitorStationRY);
},
+
+
//添加点
addPoint(data) {
//闪烁
@@ -1728,6 +1893,79 @@
}
},
+ //添加人
+ addPointPeople(data) {
+
+ let imgUrl = require("./../../../public/static/img/people.png");
+ let positionHeight = 0;
+ let scaledata = 0.4;
+ var isshow = true;
+ let placesj = new Cesium.Cartesian2(0, -60);
+ for (let i = 0; i < data.length; i++) {
+
+
+ window.earth.entities.add({
+ name: data[i].id,
+ id: data[i].id,
+ lon: parseFloat(data[i].lon),
+ lat: parseFloat(data[i].lat),
+ num: data[i].id,
+ stCode: data[i].stCode,
+ type: data[i].type,
+ show: isshow,
+ position: Cesium.Cartesian3.fromDegrees(
+ parseFloat(data[i].lon),
+ parseFloat(data[i].lat),
+ positionHeight
+ ),
+ billboard: {
+ image: imgUrl,
+ scale: scaledata,
+ // HorizontalOrigin: HorizontalOrigin.LEFT,
+ // //垂直位置
+ // verticalOrigin: VerticalOrigin.UP,
+
+ pixelOffset: new Cesium.Cartesian2(0, -40),
+ //heightReference:Cesium.CLAMP_TO_GROUND
+ //闪烁
+ // show: new Cesium.CallbackProperty(function () {
+ // if(this.currentMark=="张小明")
+ // {
+ // if (flog) {
+ // x = x - 0.05;
+ // if (x <= 0) {
+ // flog = false;
+ // }
+ // } else {
+ // x = x + 0.05;
+ // if (x >= 1) {
+ // flog = true;
+ // }
+ // }
+ // return x >= 0.5;
+ // }
+ // }, false),
+ },
+ label: {
+ text: data[i].id,
+
+ // font: '14pt monospace',
+ //font: 'Avenir, Helvetica, Arial, sans-serif',
+ font: "18px sans-serif",
+ //style: LabelStyle.FILL_AND_OUTLINE,
+ fillColor: Cesium.Color.WHITE,
+ outlineWidth: 2,
+ HorizontalOrigin: Cesium.HorizontalOrigin.LEFT,
+ //垂直位置
+ verticalOrigin: Cesium.VerticalOrigin.BUTTON,
+ //中心位置
+ pixelOffset: placesj,
+ // heightReference:Cesium.CLAMP_TO_GROUND
+ },
+ });
+ }
+ },
+
//根据type去删除对应entities
removeEntityByType(typename) {
//循环删除多个实体lable
@@ -1837,6 +2075,13 @@
// { name: 'Combine' }
// )
+
+ // var promise= window.earth.scene.addS3MTilesLayerByScp(
+ // '/supermap3Dapi/iserver/services/3D-local3DCache-Config/rest/realspace/datas/Combine/config', //地址写到config那一级
+ // //'http://192.168.100.6:8090/iserver/services/3D-local3DCache-osgbxy1/rest/realspace/datas/Combine/config', //地址写到config那一级
+ // { name: 'Combine' }
+ // )
+
promise.then((layer) => {
layer.visible = true;
@@ -2199,6 +2444,38 @@
options.start
);
},
+ fullClick() {
+ //全屏事件
+ if (this.isFullscreen == false) {
+ this.isFullscreen = true;
+ Cesium.Fullscreen.requestFullscreen(document.body);
+ }
+ //退出全屏事件
+ else {
+ this.isFullscreen = false;
+ this.exitFullScreen();
+ }
+ },
+ // 退出全屏
+ exitFullScreen(el) {
+ var el = document,
+ cfs =
+ el.cancelFullScreen ||
+ el.webkitCancelFullScreen ||
+ el.mozCancelFullScreen ||
+ el.exitFullScreen,
+ wscript;
+ if (typeof cfs != "undefined" && cfs) {
+ cfs.call(el);
+ return;
+ }
+ if (typeof window.ActiveXObject != "undefined") {
+ wscript = new ActiveXObject("WScript.Shell");
+ if (wscript != null) {
+ wscript.SendKeys("{F11}");
+ }
+ }
+ },
//飞行相关
TravelCave() {
///依次遍历加载所有隧道管线
@@ -2235,92 +2512,93 @@
routeCor.push(lonarr[kk]);
routeCor.push(latarr[kk]);
- routeCor.push(-5);
+ routeCor.push(-4);
}
routeCor.push(114.085719349506);
routeCor.push(32.0971357752289);
- routeCor.push(1.5);
+ routeCor.push(2);
routeCor.push(114.085588643839);
routeCor.push(32.0972612917984);
- routeCor.push(1.5);
+ routeCor.push(2);
routeCor.push(114.085491647299);
routeCor.push(32.097355446692);
- routeCor.push(1.5);
+ routeCor.push(2);
routeCor.push(114.085318017236);
routeCor.push(32.0975266208165);
- routeCor.push(1.5);
+ routeCor.push(2);
routeCor.push(114.085180056944);
routeCor.push(32.0976642995766);
- routeCor.push(1.5);
+ routeCor.push(2);
routeCor.push(114.085119280774);
routeCor.push(32.0977270301215);
- routeCor.push(1.5);
+ routeCor.push(2);
var lonarr1 = [
114.085255976288, 114.085102694904, 114.085014961749, 114.084923781515,
114.084786423886, 114.084692750713, 114.08460844511, 114.084534852399,
114.084479672299, 114.084400450906, 114.084291694824, 114.084214065142,
114.084115479127, 114.084036679425, 114.083948853824, 114.083828529212,
- 114.083762618346, 114.083670496717, 114.083564187366, 114.083480203343,
- 114.083397555403, 114.083285951538, 114.083209751656, 114.083146979527,
- 114.083040248719, 114.082968458143, 114.082938537003, 114.08288101482,
- 114.082811049091, 114.082774340772, 114.082727661101, 114.082680332365,
- 114.082648783926, 114.082594160631, 114.082546284847, 114.082503652205,
- 114.082434591266, 114.082384186164, 114.082308046589, 114.082250405793,
- 114.082192903706, 114.08211938981, 114.082049117193, 114.081992119443,
- 114.081940938433, 114.081879304096, 114.081824030884, 114.081748689648,
- 114.081686859164, 114.081597965895, 114.081531735095, 114.081470914758,
- 114.081400118209, 114.081330735072, 114.081271630674, 114.081224359781,
- 114.081150981215, 114.08107153615, 114.081034048701, 114.080977739837,
- 114.080925212461, 114.080852506325, 114.080752521335, 114.080700156844,
- 114.080629328236, 114.080532400489, 114.080459584228, 114.080399009685,
- 114.080335825006, 114.080242918602, 114.080179816621, 114.080181204924,
- 114.080089587943, 114.08004499385, 114.079971133277, 114.079850230649,
- 114.079784782032, 114.079729723803, 114.079660313457, 114.079583992338,
- 114.079527995873, 114.079459435964, 114.079408140909, 114.079333362151,
- 114.079230455162, 114.079146661184,
+ //114.083762618346, 114.083670496717, 114.083564187366, 114.083480203343,
+ // 114.083397555403, 114.083285951538, 114.083209751656, 114.083146979527,
+ // 114.083040248719, 114.082968458143, 114.082938537003, 114.08288101482,
+ // 114.082811049091, 114.082774340772, 114.082727661101, 114.082680332365,
+ // 114.082648783926, 114.082594160631, 114.082546284847, 114.082503652205,
+ // 114.082434591266, 114.082384186164, 114.082308046589, 114.082250405793,
+ // 114.082192903706, 114.08211938981, 114.082049117193, 114.081992119443,
+ // 114.081940938433, 114.081879304096, 114.081824030884, 114.081748689648,
+ // 114.081686859164, 114.081597965895, 114.081531735095, 114.081470914758,
+ // 114.081400118209, 114.081330735072, 114.081271630674, 114.081224359781,
+ // 114.081150981215, 114.08107153615, 114.081034048701, 114.080977739837,
+ // 114.080925212461, 114.080852506325, 114.080752521335, 114.080700156844,
+ // 114.080629328236, 114.080532400489, 114.080459584228, 114.080399009685,
+ // 114.080335825006, 114.080242918602, 114.080179816621, 114.080181204924,
+ // 114.080089587943, 114.08004499385, 114.079971133277, 114.079850230649,
+ // 114.079784782032, 114.079729723803, 114.079660313457, 114.079583992338,
+ // 114.079527995873, 114.079459435964, 114.079408140909, 114.079333362151,
+ // 114.079230455162, 114.079146661184,
];
var latarr1 = [
32.0978345684551, 32.0979785122343, 32.0980605423124, 32.0981493367731,
32.0982863273092, 32.0983793459651, 32.0984714366192, 32.0985561170528,
32.0986145838852, 32.0987069863075, 32.0988312425012, 32.0989236314715,
32.0990387312133, 32.0991307915664, 32.0992359345577, 32.0993792349995,
- 32.0994578651062, 32.0995630877418, 32.0996859900723, 32.0997828704268,
- 32.0998817346794, 32.1000085537278, 32.100095185876, 32.1001652907905,
- 32.1002875662747, 32.1003736480043, 32.1004113295985, 32.1004861755372,
- 32.1005750063695, 32.1006252253616, 32.1006890091389, 32.1007584586724,
- 32.1008019054174, 32.1008821656155, 32.1009512477213, 32.1010090678594,
- 32.1011080872234, 32.1011858150934, 32.1012975869943, 32.1013840172796,
- 32.1014718984045, 32.1015816187692, 32.1016894782681, 32.1017769762188,
- 32.1018535972501, 32.1019493609947, 32.1020317658604, 32.1021482886804,
- 32.1022408675649, 32.1023756080394, 32.1024777230103, 32.1025734534491,
- 32.10268282509, 32.102787689644, 32.1028755374286, 32.1029506991419,
- 32.1030639197819, 32.1031839026546, 32.1032421167879, 32.10333213833,
- 32.1034137656734, 32.1035220905637, 32.1036792532342, 32.1037542274605,
- 32.103833226122, 32.1039417395034, 32.1040295715129, 32.1041000089462,
- 32.1041721958583, 32.1042804199954, 32.1043520409667, 32.1043507388764,
- 32.1044545582256, 32.104506639531, 32.1045937278367, 32.1047320829662,
- 32.104803349756, 32.1048685928752, 32.1049456548293, 32.1050357306808,
- 32.1050977032556, 32.1051800454596, 32.1052386907462, 32.1053237777052,
- 32.1054423308271, 32.1055366473754,
+ //32.0994578651062, 32.0995630877418, 32.0996859900723, 32.0997828704268,
+ // 32.0998817346794, 32.1000085537278, 32.100095185876, 32.1001652907905,
+ // 32.1002875662747, 32.1003736480043, 32.1004113295985, 32.1004861755372,
+ // 32.1005750063695, 32.1006252253616, 32.1006890091389, 32.1007584586724,
+ // 32.1008019054174, 32.1008821656155, 32.1009512477213, 32.1010090678594,
+ // 32.1011080872234, 32.1011858150934, 32.1012975869943, 32.1013840172796,
+ // 32.1014718984045, 32.1015816187692, 32.1016894782681, 32.1017769762188,
+ // 32.1018535972501, 32.1019493609947, 32.1020317658604, 32.1021482886804,
+ // 32.1022408675649, 32.1023756080394, 32.1024777230103, 32.1025734534491,
+ // 32.10268282509, 32.102787689644, 32.1028755374286, 32.1029506991419,
+ // 32.1030639197819, 32.1031839026546, 32.1032421167879, 32.10333213833,
+ // 32.1034137656734, 32.1035220905637, 32.1036792532342, 32.1037542274605,
+ // 32.103833226122, 32.1039417395034, 32.1040295715129, 32.1041000089462,
+ // 32.1041721958583, 32.1042804199954, 32.1043520409667, 32.1043507388764,
+ // 32.1044545582256, 32.104506639531, 32.1045937278367, 32.1047320829662,
+ // 32.104803349756, 32.1048685928752, 32.1049456548293, 32.1050357306808,
+ // 32.1050977032556, 32.1051800454596, 32.1052386907462, 32.1053237777052,
+ // 32.1054423308271, 32.1055366473754,
];
for (let kk = 0; kk < lonarr1.length; kk++) {
routeCor.push(lonarr1[kk]);
routeCor.push(latarr1[kk]);
- routeCor.push(-5);
+ routeCor.push(-4);
}
//求全管线漫游路径routeCor
const Lines = Cesium.Cartesian3.fromDegreesArrayHeights(routeCor);
//加载飞行模型参数
const options = {
- time: 117,
+ //time: 117,
+ time: routeCor.length/3,
// time: this.video.duration,
Lines: Lines,
isPathShow: true,
@@ -2367,7 +2645,7 @@
window.earth.clock.currentTime = start.clone();
// window.earth.clock.clockRange = Cesium.ClockRange.LOOP_STOP; // Loop at the end循环
window.earth.clock.clockRange = Cesium.ClockRange.CLAMPED; //到达终止时间后自动停止
- window.earth.clock.multiplier = 0.5;
+ window.earth.clock.multiplier = 0.3;
for (let i = 0; i < lineLength; i++) {
const time = Cesium.JulianDate.addSeconds(
@@ -2391,6 +2669,38 @@
*/
InitRoaming(position, start, stop, isPathShow) {
+
+ this.finishedArray=[]
+
+ //杨工新方法
+ //定制已走过的橙色线
+ if(this.redLine)
+ {
+ //改为空的坐标
+ this.redLine.polyline.positions=new Cesium.CallbackProperty((time, result)=> {
+ //endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime);
+ return Cesium.Cartesian3.fromDegreesArrayHeights([114.08776071508423, 32.09554632853193, -4.0000002853217715, 114.08775831828851, 32.09554847106537, -4.000000519596626], Cesium.Ellipsoid.WGS84, result);
+ }, false)
+
+ }
+ else
+ {
+ this.redLine = window.earth.entities.add({
+ type:"redline",
+ polyline : {
+ // This callback updates positions each frame.
+ // positions : new Cesium.CallbackProperty(function(time, result) {
+ // //endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime);
+ // return Cesium.Cartesian3.fromDegreesArrayHeights([], Cesium.Ellipsoid.WGS84, result);
+ // }, false),
+ width : 10,
+ material : Cesium.Color.RED
+ }
+
+ });
+ }
+
+
//this.position = position;
this.entity = window.earth.entities.add({
availability: new Cesium.TimeIntervalCollection([
@@ -2401,13 +2711,19 @@
]),
// 位置
position: position,
+
// 计算朝向
+ //设置视野距离
+ viewFrom: new Cesium.Cartesian3(-25.0, -25.0, 25.0),
orientation: new Cesium.VelocityOrientationProperty(position),
model: {
- //uri: "/gltfUrl/car01.gltf",
- uri: "/gltfUrl/gltf/gongren.gltf",
+ //uri: "/gltfUrl/gongren.gltf",
+ uri: "/gltfUrl/gltf/gongren.gltf",
+ // minimumPixelSize:6400,
+ // maximumSize:128,
+ // maximumScale:200,
//uri: "/gltfUrl/00256_Daud008.fbx.glb",
scale: 0.001,
@@ -2425,7 +2741,7 @@
resolution: 1,
material: new Cesium.PolylineGlowMaterialProperty({
glowPower: 0.1,
- color: Cesium.Color.RED.withAlpha(0.5),
+ color: Cesium.Color.GREEN.withAlpha(0.5),
}),
width: 10,
show: true,
@@ -2440,8 +2756,18 @@
});
},
+ //世界坐标系转经纬度
+Cartesian3_to_WGS84(point) {
+ var cartesian33 = new Cesium.Cartesian3(point.x, point.y, point.z);
+ var cartographic = Cesium.Cartographic.fromCartesian(cartesian33);
+ var lat = Cesium.Math.toDegrees(cartographic.latitude);
+ var lng = Cesium.Math.toDegrees(cartographic.longitude);
+ var alt = cartographic.height;
+ return {lng: lng, lat: lat, alt: alt};
+},
//第一视角漫游方法
OneSeeFunc(position) {
+
// console.log("进来了onsese")
let judgeTime = Cesium.JulianDate.compare(
window.earth.clock.currentTime,
@@ -2449,6 +2775,7 @@
);
console.log(judgeTime);
if (judgeTime < 0) {
+
//设置第一视角
let hpRoll = new Cesium.HeadingPitchRoll();
const hpRange = new Cesium.HeadingPitchRange();
@@ -2457,6 +2784,36 @@
window.earth.clock.currentTime,
this.center
);
+
+ //先转为经纬度
+ var lonlatcell=this.Cartesian3_to_WGS84(this.center)
+
+ if(this.isEndRoam == false)
+ {
+ this.finishedArray.push(lonlatcell.lng)
+ this.finishedArray.push(lonlatcell.lat)
+ this.finishedArray.push(lonlatcell.alt)
+ }
+
+ console.log("this.finishedArray",this.finishedArray)
+ console.log("this.redLine",this.redLine)
+
+
+ this.redLine.polyline.positions=new Cesium.CallbackProperty((time, result)=> {
+ //endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime);
+ return Cesium.Cartesian3.fromDegreesArrayHeights(this.finishedArray, Cesium.Ellipsoid.WGS84, result);
+ }, false)
+
+ this.redLine.polyline.width = 10
+ this.redLine.polyline.material = Cesium.Color.RED
+
+
+
+ //根据center去绘制已走过的entities坐标
+
+
+ //console.log("this.center", this.center)
+
// console.log(center);
// console.log(this.entity);
// if (
@@ -2494,9 +2851,10 @@
//长丰泵站
//this.AnimateState
- if (judgeTime > -100 && judgeTime < -96 && this.ispanelCFBZ == false) {
+ // if (judgeTime > -100 && judgeTime < -96 && this.ispanelCFBZ == false) {
+ if (judgeTime > -29 && judgeTime < -25 && this.ispanelCFBZ == false) {
this.holdMY();
- console.log("开始展示长丰泵站");
+ // console.log("开始展示长丰泵站");
document.getElementById("问题2").style.display = "block";
window.earth.scene.preRender.addEventListener(() => {
@@ -2511,14 +2869,15 @@
this.ispanelCFBZ = true;
setTimeout(() => {
this.holdMY();
- console.log("停止展示长丰泵站,继续动画");
+ // console.log("停止展示长丰泵站,继续动画");
document.getElementById("问题2").style.display = "none";
}, 4000);
}
- if (judgeTime > -90 && judgeTime < -86 && this.ispanelWT1 == false) {
+ // if (judgeTime > -90 && judgeTime < -86 && this.ispanelWT1 == false) {
+ if (judgeTime > -17 && judgeTime < -13 && this.ispanelWT1 == false) {
this.holdMY();
- console.log("开始展示长丰泵站");
+ // console.log("开始展示长丰泵站");
document.getElementById("问题1").style.display = "block";
window.earth.scene.preRender.addEventListener(() => {
@@ -2533,7 +2892,7 @@
this.ispanelWT1 = true;
setTimeout(() => {
this.holdMY();
- console.log("停止展示长丰泵站,继续动画");
+ // console.log("停止展示长丰泵站,继续动画");
document.getElementById("问题1").style.display = "none";
}, 4000);
}
@@ -2601,6 +2960,12 @@
EndRoaming() {
// console.log(JulianDate.compare(window.earth.clock.currentTime, window.earth.clock.stopTime));
+ this.finishedArray=[]
+
+ if(this.redLine)
+ window.earth.entities.remove(this.redLine)
+
+
this.isEndRoam = true;
if (this.entity !== undefined) {
window.earth.entities.remove(this.entity);
@@ -2692,6 +3057,33 @@
// this.PauseOrContinue(true);
// },
endMY() {
+
+ this.isEndRoam = true
+ this.finishedArray=[]
+
+ if(this.redLine)
+ window.earth.entities.remove(this.redLine)
+ // this.redLine.polyline.positions=null
+ // this.redLine.polyline.positions=new Cesium.CallbackProperty((time, result)=> {
+ // //endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime);
+ // return Cesium.Cartesian3.fromDegreesArrayHeights([114.08776071508423, 32.09554632853193, -4.0000002853217715, 114.08775831828851, 32.09554847106537, -4.000000519596626], Cesium.Ellipsoid.WGS84, result);
+ // }, false)
+
+
+
+ // this.redLine = window.earth.entities.add({
+ // polyline : {
+ // // This callback updates positions each frame.
+ // // positions : new Cesium.CallbackProperty(function(time, result) {
+ // // //endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime);
+ // // return Cesium.Cartesian3.fromDegreesArrayHeights([], Cesium.Ellipsoid.WGS84, result);
+ // // }, false),
+ // width : 15,
+ // material : Cesium.Color.RED
+ // }
+
+ // });
+
//this.removeAllpopup()
//变量隐藏
/* //展示实时泵站面板
@@ -2718,344 +3110,831 @@
+
diff --git a/static/img/1.png b/static/img/1.png
new file mode 100644
index 0000000..3fbc701
--- /dev/null
+++ b/static/img/1.png
Binary files differ
diff --git a/static/img/2.png b/static/img/2.png
new file mode 100644
index 0000000..73748bd
--- /dev/null
+++ b/static/img/2.png
Binary files differ
diff --git a/vue.config.js b/vue.config.js
index bec1f1b..9a2ef14 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -89,7 +89,15 @@
pathRewrite: {
"^/sysApi": "" //需要rewrite重写的,
}
- }
+ },
+ "/hapi": {
+ target: "http://192.168.1.107:12002", //
+ // target: "http://192.168.100.2:9002", // 接口域名
+ changeOrigin: true, // 是否跨域
+ pathRewrite: {
+ "^/hapi": "" // 需要rewrite重写的,
+ }
+ },
}