Commit fc952a7f authored by 纪泽龙's avatar 纪泽龙

改变设备的位置,新模型

parent d85156c4
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-12-07 14:19:18 * @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-09-15 11:06:25 * @LastEditTime: 2022-09-29 20:08:54
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js * @FilePath: /cesium-vue/src/utils/seieumClass.js
...@@ -295,7 +295,7 @@ export default class CreateCesium { ...@@ -295,7 +295,7 @@ export default class CreateCesium {
let offset = Cesium.Cartesian3.fromRadians( let offset = Cesium.Cartesian3.fromRadians(
Cesium.Math.toRadians(gaodeLnglat.lng), Cesium.Math.toRadians(gaodeLnglat.lng),
Cesium.Math.toRadians(gaodeLnglat.lat), Cesium.Math.toRadians(gaodeLnglat.lat),
26 -160
); );
let translation = Cesium.Cartesian3.subtract( let translation = Cesium.Cartesian3.subtract(
offset, offset,
...@@ -312,20 +312,24 @@ export default class CreateCesium { ...@@ -312,20 +312,24 @@ export default class CreateCesium {
// 1.6454928984350525 -1.0974068412623752 0.00004639407505457882 114.14437322429676 38.398663934418344 319.0140849711926 // 1.6454928984350525 -1.0974068412623752 0.00004639407505457882 114.14437322429676 38.398663934418344 319.0140849711926
if (main) { if (main) {
this.tilesetArr.push(tileset); this.tilesetArr.push(tileset);
setTimeout(() => { setTimeout(() => {
this.viewer.scene.camera.flyTo({ this.viewer.scene.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees( destination: Cesium.Cartesian3.fromDegrees(
114.14437322429676, 114.08722973596568,
38.398663934418344, 38.251679644548084,
319.0140849711926 784
), //定位坐标点,建议使用谷歌地球坐标位置无偏差 ), //定位坐标点,建议使用谷歌地球坐标位置无偏差
orientation: { orientation: {
heading: 1.6454928984350525, // 方向 // heading: 1.6454928984350525, // 方向
pitch: -1.0974068412623752, // 倾斜角度 // pitch: -1.0974068412623752, // 倾斜角度
roll: 0.00004639407505457882, // roll: 0.00004639407505457882,
// heading: Cesium.Math.toRadians(20.0), // 方向 // heading: Cesium.Math.toRadians(20.0), // 方向
// pitch: Cesium.Math.toRadians(-90.0,), // 倾斜角度 // pitch: Cesium.Math.toRadians(-90.0,), // 倾斜角度
// roll: 1.3, // roll: 1.3,
heading: Cesium.Math.toRadians(177), // 方向
pitch: Cesium.Math.toRadians(-81.61), // 倾斜角度
// roll: 1.3,
}, },
duration: 0.1, //定位的时间间隔 duration: 0.1, //定位的时间间隔
...@@ -354,6 +358,7 @@ export default class CreateCesium { ...@@ -354,6 +358,7 @@ export default class CreateCesium {
this.createDevice(movement); this.createDevice(movement);
} }
var picked = this.scene.pick(movement.position); var picked = this.scene.pick(movement.position);
console.log("picked", picked);
if (Cesium.defined(picked)) { if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) { if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id) // console.log(picked.id)
...@@ -402,10 +407,20 @@ export default class CreateCesium { ...@@ -402,10 +407,20 @@ export default class CreateCesium {
} }
if (picked instanceof Cesium.Cesium3DTileFeature) { if (picked instanceof Cesium.Cesium3DTileFeature) {
console.log("选中了3DTile"); console.log("选中了3DTile");
const ln = this.getLnglat(movement);
console.log(ln);
} }
} }
const height = this.viewer.camera.positionCartographic.height.toFixed(0);
//方向 围绕Z轴旋转
const heading = Cesium.Math.toDegrees(this.viewer.camera.heading).toFixed(
2
);
//倾斜角度 围绕Y轴旋转
const pitch = Cesium.Math.toDegrees(this.viewer.camera.pitch).toFixed(2);
//围绕X轴旋转
const roll = Cesium.Math.toDegrees(this.viewer.camera.roll).toFixed(2);
console.log(height, heading, pitch, roll);
const ln = this.getLnglat(movement);
console.log(ln);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK); }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler.setInputAction((movement) => { handler.setInputAction((movement) => {
// 新建 // 新建
...@@ -439,6 +454,7 @@ export default class CreateCesium { ...@@ -439,6 +454,7 @@ export default class CreateCesium {
// this.clearInfoWindow(); // this.clearInfoWindow();
var picked = this.scene.pick(movement.position); var picked = this.scene.pick(movement.position);
console.log(movement.position);
if (Cesium.defined(picked)) { if (Cesium.defined(picked)) {
if (picked.id && picked.id instanceof Cesium.Entity) { if (picked.id && picked.id instanceof Cesium.Entity) {
// console.log(picked.id) // console.log(picked.id)
...@@ -1068,18 +1084,18 @@ export default class CreateCesium { ...@@ -1068,18 +1084,18 @@ export default class CreateCesium {
}); });
} }
// 危险源与风险分布区切换 // 危险源与风险分布区切换
dangeDeviceChange(type,bottomDeviceArr) { dangeDeviceChange(type, bottomDeviceArr) {
if (type == 1) { if (type == 1) {
this.deviceAllShow(true,bottomDeviceArr); this.deviceAllShow(true, bottomDeviceArr);
this.dangerAllShow(false); this.dangerAllShow(false);
} else { } else {
this.deviceAllShow(false,bottomDeviceArr); this.deviceAllShow(false, bottomDeviceArr);
this.dangerAllShow(true); this.dangerAllShow(true);
} }
this.clearInfoWindow(); this.clearInfoWindow();
} }
destroy(){ destroy() {
this.viewer.destroy() this.viewer.destroy();
} }
// 兼容性 // 兼容性
compatibility() { compatibility() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40 * @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-15 11:06:58 * @LastEditTime: 2022-09-29 20:51:09
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue * @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -44,16 +44,16 @@ export default { ...@@ -44,16 +44,16 @@ export default {
danger: true, danger: true,
data1: [ data1: [
{ {
deviceType: 1, deviceType: 11,
longitude: 114.14663479560947, longitude: 114.08572154613417,
latitude: 38.39968509861548, latitude: 38.25127267081466,
shortNum: 10, shortNum: 10,
title: "视频1", title: "视频1",
}, },
{ {
deviceType: 1, deviceType: 11,
longitude: 114.14649648472712, longitude: 114.08582661394571,
latitude: 38.39869677916153, latitude: 38.249478441102596,
shortNum: 16, shortNum: 16,
title: "视频2", title: "视频2",
}, },
...@@ -61,9 +61,9 @@ export default { ...@@ -61,9 +61,9 @@ export default {
data2: [ data2: [
{ {
deviceType: 3, deviceType: 3,
longitude: 114.14625055544744, longitude: 114.08274961653991,
latitude: 38.398166454284954, latitude: 38.24983876031178,
shortNum: 6.8, shortNum: 15,
title: "气体探测器", title: "气体探测器",
sbmc: "气体探测器", sbmc: "气体探测器",
sbbh: "HBS030015037", sbbh: "HBS030015037",
...@@ -72,9 +72,9 @@ export default { ...@@ -72,9 +72,9 @@ export default {
}, },
{ {
deviceType: 4, deviceType: 4,
longitude: 114.14621150048251, longitude: 114.08344461545148,
latitude: 38.39789280073286, latitude: 38.249814328043456,
shortNum: 6, shortNum: 15,
title: "压力探测器", title: "压力探测器",
sbmc: "压力探测器", sbmc: "压力探测器",
sbbh: "HBS030015037", sbbh: "HBS030015037",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40 * @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-15 11:07:03 * @LastEditTime: 2022-09-29 20:47:06
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue * @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -63,9 +63,9 @@ export default { ...@@ -63,9 +63,9 @@ export default {
data2: [ data2: [
{ {
deviceType: 2, deviceType: 2,
longitude: 114.14672123792258, longitude: 114.0820982066482,
latitude: 38.39948060410065, latitude: 38.2500435240177,
shortNum: 3, shortNum: 7,
title: "锅炉点火", title: "锅炉点火",
wxymc: "煤气管道", wxymc: "煤气管道",
zj: "DN1600", zj: "DN1600",
...@@ -80,9 +80,9 @@ export default { ...@@ -80,9 +80,9 @@ export default {
}, },
{ {
deviceType: 2, deviceType: 2,
longitude: 114.14655518560048, longitude: 114.08743529141078,
latitude: 38.39788434842992, latitude: 38.25117222006519,
// shortNum: 2, shortNum: 3,
title: "有害气体", title: "有害气体",
wxymc: "氮气储罐", wxymc: "氮气储罐",
gtrl: "2万m3", gtrl: "2万m3",
...@@ -101,10 +101,10 @@ export default { ...@@ -101,10 +101,10 @@ export default {
danger: [ danger: [
{ {
lnglatArr: [ lnglatArr: [
[114.14717670710164, 38.40005636539567], [114.08693257466244, 38.25122825128276],
[114.1468107102057, 38.40007904127634], [114.08837308345032, 38.25125456736997],
[114.14667960459407, 38.39920633274406], [114.08840384602489, 38.25162426832718],
[114.14701877614534, 38.39915715155819], [114.08696540004983, 38.25155912109927],
], ],
colorNum: 1, colorNum: 1,
fxlb: "高风险区域", fxlb: "高风险区域",
...@@ -125,10 +125,10 @@ export default { ...@@ -125,10 +125,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14677730159013, 38.39705223282708], [114.08840968324529, 38.250338608553484],
[114.14649230680254, 38.397063948491684], [114.08705000996402, 38.25027411252165],
[114.14667103104993, 38.39892681891495], [114.08700204531098, 38.25062619768719],
[114.14701528471832, 38.398899416956155], [114.08841768197132, 38.25062352404105],
], ],
colorNum: 2, colorNum: 2,
fxlb: "中风险区域", fxlb: "中风险区域",
...@@ -149,10 +149,10 @@ export default { ...@@ -149,10 +149,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14625043839335, 38.398287521835094], [114.0845936659788, 38.25105615106475],
[114.14571696614324, 38.3983232240641], [114.0829142987991, 38.25093102454791],
[114.14564758455208, 38.397642064332715], [114.08281445503589, 38.251806239979324],
[114.14616102903275, 38.39756712393071], [114.0845864560673, 38.251975928617924],
], ],
colorNum: 3, colorNum: 3,
fxlb: "低风险区域", fxlb: "低风险区域",
...@@ -173,10 +173,10 @@ export default { ...@@ -173,10 +173,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14657693947383, 38.39841324770322], [114.08289927467062, 38.25012951022719],
[114.14575681650135, 38.398475652278066], [114.08105697693159, 38.25003862859106],
[114.14593342445129, 38.39992212369578], [114.08100925876086, 38.25057715370437],
[114.14674496633742, 38.39987290751477], [114.08286147538506, 38.2507022435366],
], ],
colorNum: 4, colorNum: 4,
fxlb: "中低风险区域", fxlb: "中低风险区域",
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
beforeDestroy() { beforeDestroy() {
// 挂掉该关的 infowindow 跟计算infowindow位置的计时器 // 挂掉该关的 infowindow 跟计算infowindow位置的计时器
this.Cesium.clearInfoWindow(); this.Cesium.clearInfoWindow();
this.Cesium.destroy() this.Cesium.destroy();
}, },
}; };
</script> </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com * @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24 * @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-09-15 11:06:49 * @LastEditTime: 2022-09-29 20:25:44
* @FilePath: /danger-manage-web/src/views/index.vue * @FilePath: /danger-manage-web/src/views/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -54,9 +54,9 @@ export default { ...@@ -54,9 +54,9 @@ export default {
data2: [ data2: [
{ {
deviceType: 2, deviceType: 2,
longitude: 114.14672123792258, longitude: 114.0820982066482,
latitude: 38.39948060410065, latitude: 38.2500435240177,
shortNum: 3, shortNum: 7,
title: "锅炉点火", title: "锅炉点火",
wxymc: "煤气管道", wxymc: "煤气管道",
zj: "DN1600", zj: "DN1600",
...@@ -71,9 +71,9 @@ export default { ...@@ -71,9 +71,9 @@ export default {
}, },
{ {
deviceType: 2, deviceType: 2,
longitude: 114.14655518560048, longitude: 114.08743529141078,
latitude: 38.39788434842992, latitude: 38.25117222006519,
// shortNum: 2, shortNum: 3,
title: "有害气体", title: "有害气体",
wxymc: "氮气储罐", wxymc: "氮气储罐",
gtrl: "2万m3", gtrl: "2万m3",
...@@ -92,10 +92,10 @@ export default { ...@@ -92,10 +92,10 @@ export default {
danger: [ danger: [
{ {
lnglatArr: [ lnglatArr: [
[114.14717670710164, 38.40005636539567], [114.08693257466244, 38.25122825128276],
[114.1468107102057, 38.40007904127634], [114.08837308345032, 38.25125456736997],
[114.14667960459407, 38.39920633274406], [114.08840384602489, 38.25162426832718],
[114.14701877614534, 38.39915715155819], [114.08696540004983, 38.25155912109927],
], ],
colorNum: 1, colorNum: 1,
fxlb: "高风险区域", fxlb: "高风险区域",
...@@ -116,10 +116,10 @@ export default { ...@@ -116,10 +116,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14677730159013, 38.39705223282708], [114.08840968324529, 38.250338608553484],
[114.14649230680254, 38.397063948491684], [114.08705000996402, 38.25027411252165],
[114.14667103104993, 38.39892681891495], [114.08700204531098, 38.25062619768719],
[114.14701528471832, 38.398899416956155], [114.08841768197132, 38.25062352404105],
], ],
colorNum: 2, colorNum: 2,
fxlb: "中风险区域", fxlb: "中风险区域",
...@@ -140,10 +140,10 @@ export default { ...@@ -140,10 +140,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14625043839335, 38.398287521835094], [114.0845936659788, 38.25105615106475],
[114.14571696614324, 38.3983232240641], [114.0829142987991, 38.25093102454791],
[114.14564758455208, 38.397642064332715], [114.08281445503589, 38.251806239979324],
[114.14616102903275, 38.39756712393071], [114.0845864560673, 38.251975928617924],
], ],
colorNum: 3, colorNum: 3,
fxlb: "低风险区域", fxlb: "低风险区域",
...@@ -164,10 +164,10 @@ export default { ...@@ -164,10 +164,10 @@ export default {
}, },
{ {
lnglatArr: [ lnglatArr: [
[114.14657693947383, 38.39841324770322], [114.08289927467062, 38.25012951022719],
[114.14575681650135, 38.398475652278066], [114.08105697693159, 38.25003862859106],
[114.14593342445129, 38.39992212369578], [114.08100925876086, 38.25057715370437],
[114.14674496633742, 38.39987290751477], [114.08286147538506, 38.2507022435366],
], ],
colorNum: 4, colorNum: 4,
fxlb: "中低风险区域", fxlb: "中低风险区域",
...@@ -190,15 +190,15 @@ export default { ...@@ -190,15 +190,15 @@ export default {
data11: [ data11: [
{ {
deviceType: 11, deviceType: 11,
longitude: 114.14663479560947, longitude: 114.08572154613417,
latitude: 38.39968509861548, latitude: 38.25127267081466,
shortNum: 10, shortNum: 10,
title: "视频1231231231231", title: "视频1231231231231",
}, },
{ {
deviceType: 11, deviceType: 11,
longitude: 114.14649648472712, longitude: 114.08579042117636,
latitude: 38.39869677916153, latitude: 38.24949662796779,
shortNum: 16, shortNum: 16,
title: "视频2", title: "视频2",
}, },
...@@ -207,8 +207,8 @@ export default { ...@@ -207,8 +207,8 @@ export default {
{ {
deviceType: 12, deviceType: 12,
deviceState: 1, deviceState: 1,
longitude: 114.14602680153222, longitude: 114.08259457996853,
latitude: 38.39935782980017, latitude: 38.25080252536212,
shortNum: 12, shortNum: 12,
title: "报警器", title: "报警器",
sbmc: "气体报警器", sbmc: "气体报警器",
...@@ -219,8 +219,8 @@ export default { ...@@ -219,8 +219,8 @@ export default {
{ {
deviceType: 12, deviceType: 12,
deviceState: 2, deviceState: 2,
longitude: 114.14600224331788, longitude: 114.08158936858243,
latitude: 38.399070848235894, latitude: 38.25068850682793,
shortNum: 12, shortNum: 12,
title: "报警器", title: "报警器",
sbmc: "气体报警器", sbmc: "气体报警器",
...@@ -231,8 +231,8 @@ export default { ...@@ -231,8 +231,8 @@ export default {
{ {
deviceType: 12, deviceType: 12,
deviceState: 3, deviceState: 3,
longitude: 114.14629336753252, longitude: 114.08105373626017,
latitude: 38.3993544427342, latitude: 38.2510912127248,
shortNum: 12, shortNum: 12,
title: "报警器", title: "报警器",
sbmc: "气体报警器", sbmc: "气体报警器",
...@@ -242,9 +242,9 @@ export default { ...@@ -242,9 +242,9 @@ export default {
}, },
{ {
deviceType: 13, deviceType: 13,
longitude: 114.14627582820893, longitude: 114.08375950924253,
latitude: 38.3985068453153, latitude: 38.25066072012857,
shortNum: 6, shortNum: 8,
title: "探测器", title: "探测器",
sbmc: "电力探测器", sbmc: "电力探测器",
sbbh: "HBS030015032", sbbh: "HBS030015032",
...@@ -254,9 +254,9 @@ export default { ...@@ -254,9 +254,9 @@ export default {
}, },
{ {
deviceType: 14, deviceType: 14,
longitude: 114.14621150048251, longitude: 114.08344461545148,
latitude: 38.39789280073286, latitude: 38.249814328043456,
shortNum: 6, shortNum: 8,
title: "探测器", title: "探测器",
sbmc: "压力探测器", sbmc: "压力探测器",
sbbh: "HBS030015037", sbbh: "HBS030015037",
...@@ -266,9 +266,9 @@ export default { ...@@ -266,9 +266,9 @@ export default {
}, },
{ {
deviceType: 14, deviceType: 14,
longitude: 114.14626646534612, longitude: 114.08201936134395,
latitude: 38.39910369763971, latitude: 38.25019833311851,
shortNum: 6, shortNum: 8,
title: "探测器", title: "探测器",
sbmc: "压力探测器", sbmc: "压力探测器",
sbbh: "HBS030015037", sbbh: "HBS030015037",
...@@ -278,9 +278,9 @@ export default { ...@@ -278,9 +278,9 @@ export default {
}, },
{ {
deviceType: 15, deviceType: 15,
longitude: 114.14636713813782, longitude: 114.08274961653991,
latitude: 38.3992058619738761, latitude: 38.24983876031178,
shortNum: 6, shortNum: 8,
title: "探测器", title: "探测器",
sbmc: "温度探测器", sbmc: "温度探测器",
sbbh: "HBS030015037", sbbh: "HBS030015037",
...@@ -316,7 +316,7 @@ export default { ...@@ -316,7 +316,7 @@ export default {
beforeDestroy() { beforeDestroy() {
// 挂掉该关的 infowindow 跟计算infowindow位置的计时器 // 挂掉该关的 infowindow 跟计算infowindow位置的计时器
this.Cesium.clearInfoWindow(); this.Cesium.clearInfoWindow();
this.Cesium.destroy() this.Cesium.destroy();
}, },
methods: { methods: {
//进入此页面监听路由变化 让最顶上的东西隐藏 //进入此页面监听路由变化 让最顶上的东西隐藏
...@@ -365,7 +365,7 @@ export default { ...@@ -365,7 +365,7 @@ export default {
this.deviceOrDangerType = e.type; this.deviceOrDangerType = e.type;
} }
console.log(this.$refs.bottom.activeArr); console.log(this.$refs.bottom.activeArr);
this.Cesium.dangeDeviceChange(e.type,this.$refs.bottom.activeArr); this.Cesium.dangeDeviceChange(e.type, this.$refs.bottom.activeArr);
}, },
// DeviceChange(){ // DeviceChange(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment