Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
mmc-stl-vue2
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Administrator
mmc-stl-vue2
Commits
668cbd83
提交
668cbd83
authored
12月 05, 2025
作者:
“kai”
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(地图组件): 添加用户经纬度参数并调整默认视角
为CesiumLayout组件添加latitude和longitude props,使用用户位置作为默认视角 调整初始视角高度为5000米,移除调试日志
上级
1ee2569a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
11 行删除
+23
-11
index.vue
...s/MMCFlightControlCenter/components/cesiumLayer/index.vue
+20
-9
index.vue
src/components/MMCFlightControlCenter/index.vue
+3
-2
没有找到文件。
src/components/MMCFlightControlCenter/components/cesiumLayer/index.vue
浏览文件 @
668cbd83
...
...
@@ -9,11 +9,21 @@ import _2dList from "./lib/2d";
export
default
{
name
:
"CesiumLayer"
,
props
:
{
latitude
:
{
type
:
Number
,
default
:
null
,
},
longitude
:
{
type
:
Number
,
default
:
null
,
},
},
data
()
{
return
{
viewer
:
null
,
init_lng
:
11
2.576667
,
init_lat
:
23.175833
,
init_lng
:
11
3.855071
,
init_lat
:
22.555942
,
init_alt
:
5000
,
imageryLayers
:
{
night
:
null
,
// 夜景图
...
...
@@ -46,12 +56,12 @@ export default {
this
.
$bus
.
$on
(
"handlePositions"
,
(
e
)
=>
{
this
.
init_lng
=
e
[
0
];
this
.
init_lat
=
e
[
1
];
this
.
init_alt
=
300
000
;
this
.
init_alt
=
5
000
;
this
.
viewer
.
scene
.
camera
.
flyTo
({
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
this
.
init_lng
,
this
.
init_lat
,
this
.
init_alt
this
.
longitude
||
this
.
init_lng
,
this
.
latitude
||
this
.
init_lat
,
this
.
init_alt
),
});
});
...
...
@@ -169,11 +179,12 @@ export default {
this
.
imageryLayers
.
night
.
show
=
false
;
this
.
imageryLayers
.
street
.
show
=
false
;
this
.
imageryLayers
.
star_satellite
.
show
=
false
;
console
.
log
(
'xxx'
,
this
.
latitude
,
this
.
longitude
);
this
.
viewer
.
scene
.
camera
.
flyTo
({
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
this
.
init_lng
,
this
.
init_lat
,
this
.
longitude
||
this
.
init_lng
,
this
.
latitude
||
this
.
init_lat
,
this
.
init_alt
),
});
...
...
src/components/MMCFlightControlCenter/index.vue
浏览文件 @
668cbd83
<
template
>
<div
class=
"mmc-filght-control-center mmc"
>
<!-- cesium地图层 -->
<CesiumLayout
v-if=
"!cesiumViewer"
></CesiumLayout>
<CesiumLayout
v-if=
"!cesiumViewer"
:latitude=
"parseFloat(userInfo.latitude)"
:longitude=
"parseFloat(userInfo.longitude)"
></CesiumLayout>
<!-- 地图切换组件 -->
<MapImageSwitch></MapImageSwitch>
<MapSearch
class=
"map-search"
></MapSearch>
...
...
@@ -106,7 +106,8 @@ export default {
watch
:
{
userInfo
:
{
immediate
:
true
,
handler
()
{
handler
(
value
)
{
console
.
log
(
value
.
latitude
,
value
.
longitude
,
'xxx'
);
this
.
$store
.
commit
(
"MMCFlightControlCenter/setState"
,
{
key
:
"token"
,
value
:
this
.
userInfo
.
token
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论