Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
4903d898
Commit
4903d898
authored
Mar 14, 2023
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多增加了一个模型
parent
4fc35898
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
31 deletions
+100
-31
package.json
danger-manage-web/package.json
+1
-0
cesiumClass.js
danger-manage-web/src/utils/cesium/cesiumClass.js
+49
-17
index.vue
danger-manage-web/src/views/bigWindow/index.vue
+15
-7
index.vue
danger-manage-web/src/views/dangerScale/profile/index.vue
+9
-3
index.vue
danger-manage-web/src/views/index.vue
+26
-4
No files found.
danger-manage-web/package.json
View file @
4903d898
...
...
@@ -36,6 +36,7 @@
"@riophae/vue-treeselect"
:
"^0.4.0"
,
"axios"
:
"0.21.0"
,
"clipboard"
:
"2.0.6"
,
"gcoord"
:
"^0.3.2"
,
"core-js"
:
"^3.19.1"
,
"echarts"
:
"^5.3.3"
,
"element-ui"
:
"^2.15.10"
,
...
...
danger-manage-web/src/utils/cesium/cesiumClass.js
View file @
4903d898
/*
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 202
2-10-22 10:31:44
* @LastEditTime: 202
3-03-10 11:16:03
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
*/
import
gcoord
from
"gcoord"
;
const
MAPTYPE
=
{
gps
:
"WGS84"
,
gaode
:
"GCJ02"
,
baidu
:
"BD09"
,
};
window
.
danger
=
{
name
:
""
,
colorNum
:
null
,
path
:
[],
data
:
{}
};
window
.
dangerArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'J'
)
)?.
length
>
0
?
JSON
.
parse
(
localStorage
.
getItem
(
'J'
)
):
[];
window
.
dangerArr
=
JSON
.
parse
(
localStorage
.
getItem
(
"J"
))?.
length
>
0
?
JSON
.
parse
(
localStorage
.
getItem
(
"J"
))
:
[];
window
.
repeat
=
()
=>
{
window
.
danger
=
{
name
:
""
,
path
:
[],
data
:
{}
};
};
...
...
@@ -15,8 +26,8 @@ window.save = () => {
window
.
dangerArr
.
push
(
window
.
danger
);
const
json
=
JSON
.
stringify
(
window
.
dangerArr
);
localStorage
.
setItem
(
"J"
,
json
);
console
.
log
(
json
)
window
.
repeat
()
console
.
log
(
json
)
;
window
.
repeat
()
;
};
var
viewModel
=
{
...
...
@@ -295,10 +306,12 @@ export default class CreateCesium {
* @return {*}
*/
async
addtiles
(
urlArr
,
main
)
{
urlArr
.
forEach
((
url
)
=>
{
console
.
log
(
"urlArr"
,
urlArr
);
urlArr
.
forEach
((
item
)
=>
{
const
tileset
=
new
Cesium
.
Cesium3DTileset
({
url
,
url
:
item
.
url
,
});
this
.
scene
.
primitives
.
add
(
tileset
);
// console.log("adsf")
tileset
.
readyPromise
.
then
(
async
(
tileset
)
=>
{
...
...
@@ -308,12 +321,18 @@ export default class CreateCesium {
);
const
longitudeString
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
longitude
);
const
latitudeString
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
latitude
);
var
gps
=
[
longitudeString
,
latitudeString
];
console
.
log
(
"tileset加载完毕"
,
gps
);
var
lnglat
=
[
longitudeString
,
latitudeString
];
console
.
log
(
"tileset加载完毕"
,
lnglat
);
// 阻塞转换成高德坐标
let
gaodeLnglat
=
(
await
this
.
gpsToGaode
(
gps
))[
0
];
console
.
log
(
"坐标换算完毕"
,
gaodeLnglat
);
// 如果startMapType起始是gps,则不转换,如果起始是高德就要转换,因为现在用的是gps的坐标系
let
nowLngLat
;
if
(
item
.
startMapType
===
"gps"
)
{
nowLngLat
=
lnglat
;
}
else
{
// nowLngLat = (await this.gpsToGaode(gps))[0];
nowLngLat
=
this
.
gaodeToGps
(
lnglat
,
item
);
}
console
.
log
(
"坐标换算完毕123123123123123123"
,
nowLngLat
);
// AMap.convertFrom(gps, "gps", (status, result) =>{
// if (result.info === "ok") {
// var lnglats = result.locations; // Array.<LngLat>
...
...
@@ -326,9 +345,9 @@ export default class CreateCesium {
0.0
);
let
offset
=
Cesium
.
Cartesian3
.
fromRadians
(
Cesium
.
Math
.
toRadians
(
gps
[
0
]),
Cesium
.
Math
.
toRadians
(
gps
[
1
]),
-
161.1
Cesium
.
Math
.
toRadians
(
nowLngLat
[
0
]),
Cesium
.
Math
.
toRadians
(
nowLngLat
[
1
]),
item
.
height
);
// let offset = Cesium.Cartesian3.fromRadians(
// Cesium.Math.toRadians(gaodeLnglat.lng),
...
...
@@ -345,7 +364,7 @@ export default class CreateCesium {
color
:
"color('rgba(255,255,255,1)')"
,
});
// 主场景12312312;
console
.
log
(
"gaodeLnglat"
,
gaodeLnglat
);
//
console.log("gaodeLnglat", gaodeLnglat);
console
.
log
(
"main"
,
main
);
// 1.6454928984350525 -1.0974068412623752 0.00004639407505457882 114.14437322429676 38.398663934418344 319.0140849711926
if
(
main
)
{
...
...
@@ -354,8 +373,9 @@ export default class CreateCesium {
setTimeout
(()
=>
{
this
.
viewer
.
scene
.
camera
.
flyTo
({
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
114.08040670822453
,
38.24912720167037
,
// 114.08040670822453,
// 38.24912720167037,
...
nowLngLat
,
784
),
//定位坐标点,建议使用谷歌地球坐标位置无偏差
orientation
:
{
...
...
@@ -1075,6 +1095,18 @@ export default class CreateCesium {
});
});
}
// 转换坐标
gaodeToGps
(
lnglatArr
,
data
)
{
console
.
log
(
MAPTYPE
[
data
.
startMapType
],
MAPTYPE
[
data
.
toMapType
]);
let
a
=
gcoord
.
transform
(
lnglatArr
,
// 经纬度坐标
gcoord
[
MAPTYPE
[
data
.
startMapType
]],
// 当前坐标系
gcoord
[
MAPTYPE
[
data
.
toMapType
]]
// 目标坐标系
// gcoord.GCJ02,
// gcoord.WGS84
);
return
a
;
}
// 相机镜头
zoomTo
(
tileset
)
{
this
.
viewer
.
zoomTo
(
tileset
);
...
...
danger-manage-web/src/views/bigWindow/index.vue
View file @
4903d898
...
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 202
2-09-15 11:07:1
0
* @LastEditTime: 202
3-03-14 09:39:5
0
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -29,12 +29,12 @@ import Video from "@/components/bigWindow/video";
import
Null
from
"@/components/bigWindow/Null"
;
import
Danger
from
"@/components/bigWindow/Danger"
;
import
danger
from
"@/assets/images/danger.png"
;
import
Editor
from
'@/components/Editor'
;
import
Editor
from
"@/components/Editor"
;
export
default
{
name
:
"bigWindow"
,
components
:{
Editor
components
:
{
Editor
,
},
data
()
{
return
{
...
...
@@ -179,10 +179,18 @@ export default {
],
};
},
mounted
()
{
this
.
Cesium
=
new
CreateCesium
(
"mapbox"
,
[
"../3dtiles/jsondata/tileset.json"
],
[
{
url
:
"../3dtiles/jsondata/tileset.json"
,
//路径
startMapType
:
"gps"
,
//初始坐标系
toMapType
:
""
,
//要转换坐标系
height
:
-
161.1
,
//模型高度调整
},
],
this
);
this
.
danger
.
forEach
((
item
)
=>
{
...
...
@@ -205,7 +213,7 @@ export default {
beforeDestroy
()
{
// 挂掉该关的 infowindow 跟计算infowindow位置的计时器
this
.
Cesium
.
clearInfoWindow
();
this
.
Cesium
.
destroy
()
this
.
Cesium
.
destroy
()
;
},
};
</
script
>
...
...
@@ -225,7 +233,7 @@ export default {
right
:
20px
;
z-index
:
10
;
}
.go-index
{
.go-index
{
position
:
fixed
;
top
:
20px
;
left
:
20px
;
...
...
danger-manage-web/src/views/dangerScale/profile/index.vue
View file @
4903d898
...
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-16 15:03:40
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2023-0
2-01 09:48:4
7
* @LastEditTime: 2023-0
3-14 09:36:3
7
* @FilePath: /danger-manage-web/src/views/bigwindow/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -207,7 +207,13 @@ export default {
mounted
()
{
this
.
Cesium
=
new
CreateCesium
(
"mapbox"
,
[
"../3dtiles/jsondata/tileset.json"
],
// ["../3dtiles/jsondata/tileset.json"],
{
url
:
"../3dtiles/jsondata/tileset.json"
,
//路径
startMapType
:
"gps"
,
//初始坐标系
toMapType
:
""
,
//要转换坐标系
height
:
-
161.1
,
//模型高度调整
},
this
);
// this.danger.forEach((item) => {
...
...
@@ -251,7 +257,7 @@ export default {
<
style
lang=
"scss"
scoped
>
.big-window
{
width
:
100%
;
position
:relative
;
position
:
relative
;
// height: calc(100vh - 84px);
height
:
calc
(
100vh
-
50px
);
#mapbox
{
...
...
danger-manage-web/src/views/index.vue
View file @
4903d898
...
...
@@ -2,7 +2,7 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 202
2-11-22 14:16:37
* @LastEditTime: 202
3-03-14 09:39:00
* @FilePath: /danger-manage-web/src/views/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -362,7 +362,27 @@ export default {
mounted
()
{
this
.
Cesium
=
new
CreateCesium
(
"mapbox"
,
[
"../3dtiles/jsondata/tileset.json"
],
// ["../3dtiles/jsondata/tileset.json"],
[
{
url
:
"../3dtiles/jsondata/tileset.json"
,
//路径
startMapType
:
"gps"
,
//初始坐标系
toMapType
:
""
,
//要转换坐标系
height
:
-
161.1
,
//模型高度调整
},
{
url
:
"../3dtiles/ZeHongZhuanHuan/tileset.json"
,
startMapType
:
"gps"
,
toMapType
:
"gps"
,
height
:
35
,
},
// {
// url: "../3dtiles/MapTilerCeShi/tileset.json",
// startMapType: "gaode",
// toMapType: "gps",
// height: -161,
// },
],
this
);
this
.
init
();
...
...
@@ -436,7 +456,7 @@ export default {
// 视频
if
(
item
.
mapDeviceType
==
5
)
{
console
.
log
(
item
,
"item"
);
console
.
log
(
item
,
"item"
);
obj
=
{
latitude
:
item
.
latitude
,
longitude
:
item
.
longitude
,
...
...
@@ -460,7 +480,9 @@ export default {
// 探测介质
tcjz
:
item
.
mapDeviceMedium
,
sbzt
:
item
.
monitorDeviceStatus
,
jcz
:
item
.
monitorValue
?
item
.
monitorValue
+
""
+
item
.
mapDeviceUnit
:
'-'
,
jcz
:
item
.
monitorValue
?
item
.
monitorValue
+
""
+
item
.
mapDeviceUnit
:
"-"
,
shortNum
:
12
,
config
:
{
scale
:
1
,
textHeight
:
-
94
},
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment