Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
蒋波涛
/
super_globe_vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3a1f7960
authored
2019-12-12 14:03:06 +0800
by
unknown
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
'20191212'
1 parent
a3e46c8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
15 deletions
src/components/viewer_3dmodel.vue
src/components/viewer_ms3m.vue
src/components/viewer_s3m_wz.vue
src/views/Home.vue
src/components/viewer_3dmodel.vue
View file @
3a1f796
...
...
@@ -4,7 +4,7 @@
* @Author: jiangbotao
* @Date: 2019-12-07 14:24:01
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-1
0 10:17:09
* @LastEditTime: 2019-12-1
2 14:00:47
* @FilePath: \superglobevue\src\components\viewer_3dmodel.vue
-->
<
template
>
...
...
@@ -30,6 +30,7 @@
<div
class=
"circle4"
></div>
</div>
</div>
<div
id=
"footer"
>
坐标信息
</div>
</div>
</
template
>
...
...
@@ -53,15 +54,16 @@ export default {
}
},
mounted
:
function
(){
this
.
smviewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
animation
:
true
});
var
scene
=
this
.
smviewer
.
scene
;
var
widget
=
this
.
smviewer
.
cesiumWidget
;
var
__this
=
this
;
__this
.
smviewer
=
new
Cesium
.
Viewer
(
'cesiumContainer'
,
{
animation
:
true
});
var
scene
=
__this
.
smviewer
.
scene
;
var
widget
=
__this
.
smviewer
.
cesiumWidget
;
// 隐藏logo
$
(
".cesium-widget-credits"
)[
0
].
style
.
visibility
=
"hidden"
;
$
(
".cesium-viewer-animationContainer"
)[
0
].
style
.
visibility
=
"hidden"
;
// 隐藏导航工具
// $(".cesium-viewer-navigationContainer")[0].style.visibility="hidden";
this
.
smviewer
.
imageryLayers
.
addImageryProvider
(
new
Cesium
.
TiandituImageryProvider
({
__
this
.
smviewer
.
imageryLayers
.
addImageryProvider
(
new
Cesium
.
TiandituImageryProvider
({
mapStyle
:
Cesium
.
TiandituMapsStyle
.
IMG_C
,
token
:
URL_CONFIG
.
TOKEN_TIANDITU
}));
...
...
@@ -74,13 +76,15 @@ export default {
//设置图层的阴影模式
scene
.
camera
.
setView
({
//将经度、纬度、高度的坐标转换为笛卡尔坐标
destination
:
new
Cesium
.
Cartesian3
(
-
2323607.7945701713
,
5386182.530303348
,
2505814.811681112
),
destination
:
Cesium
.
Cartesian3
.
fromDegrees
(
113.3232
,
23.1305
,
830.0
),
orientation
:
{
heading
:
4.844795866469065
,
pitch
:
-
0.58125995096984
,
roll
:
1.2504663970958063
e
-
11
// 指向
heading
:
Cesium
.
Math
.
toRadians
(
45
,
0
),
// 视角
pitch
:
Cesium
.
Math
.
toRadians
(
-
60
),
roll
:
0.0
}
});
});
},
function
(
e
){
if
(
widget
.
_showRenderLoopErrors
)
{
var
title
=
'加载SCP失败,请检查网络连接状态或者url地址是否正确?'
;
...
...
@@ -92,7 +96,25 @@ export default {
var
title
=
'渲染时发生错误,已停止渲染。'
;
widget
.
showErrorPanel
(
title
,
undefined
,
e
);
}
}
}
var
handler
=
new
Cesium
.
ScreenSpaceEventHandler
(
__this
.
smviewer
.
canvas
);
var
ellipsoid
=
__this
.
smviewer
.
scene
.
globe
.
ellipsoid
;
handler
.
setInputAction
(
function
(
e
)
{
var
cartesian
=
__this
.
smviewer
.
camera
.
pickEllipsoid
(
e
.
endPosition
,
ellipsoid
);
if
(
cartesian
){
//将笛卡尔三维坐标转为地图坐标(弧度)
var
cartographic
=
scene
.
globe
.
ellipsoid
.
cartesianToCartographic
(
cartesian
);
//将地图坐标(弧度)转为十进制的度数
var
lat_String
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
latitude
).
toFixed
(
4
);
var
log_String
=
Cesium
.
Math
.
toDegrees
(
cartographic
.
longitude
).
toFixed
(
4
);
var
alti_String
=
(
__this
.
smviewer
.
camera
.
positionCartographic
.
height
).
toFixed
(
2
);
console
.
log
(
lat_String
+
' '
+
log_String
);
$
(
'#footer'
).
text
(
'经度 : '
+
log_String
+
' | 纬度 : '
+
lat_String
+
' | 高度 : '
+
alti_String
);
}
},
Cesium
.
ScreenSpaceEventType
.
MOUSE_MOVE
);
$
(
'#loadingbar'
).
remove
();
}
}
...
...
@@ -111,4 +133,15 @@ export default {
.sm-zoom
{
top
:
130px
;
}
#footer
{
height
:
20px
;
width
:
100%
;
bottom
:
0px
;
margin
:
0px
;
padding-left
:
10px
;
position
:
absolute
;
background-color
:
rgba
(
173
,
173
,
173
,
0.3
);
color
:
white
;
text-align
:
left
;
}
</
style
>
\ No newline at end of file
...
...
src/components/viewer_ms3m.vue
View file @
3a1f796
...
...
@@ -3,7 +3,7 @@
* 添加倾斜摄影场景和倾斜摄影图层
* @Date: 2019-12-02 09:05:50
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-
07 14:03:39
* @LastEditTime: 2019-12-
12 14:02:01
* @FilePath: \WebGL_Webpack_Vue\components\viewer.vue
-->
<
template
>
...
...
src/components/viewer_s3m_wz.vue
View file @
3a1f796
...
...
@@ -3,7 +3,7 @@
* @Author: jiangbotao
* @Date: 2019-12-03 22:52:56
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-
09 09:46:34
* @LastEditTime: 2019-12-
12 13:46:50
* @FilePath: \superglobevue\src\components\viewer.vue
-->
<
template
>
...
...
src/views/Home.vue
View file @
3a1f796
...
...
@@ -2,7 +2,7 @@
* @Author: jiangbotao
* @Date: 2019-12-03 22:31:08
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-1
0 11:23:56
* @LastEditTime: 2019-12-1
2 14:00:31
* @FilePath: \superglobevue\src\views\Home.vue
-->
<
template
>
...
...
@@ -10,7 +10,7 @@
</
template
>
<
script
>
import
viewer
from
"@/components/viewer_
ymo
.vue"
;
import
viewer
from
"@/components/viewer_
ms3m
.vue"
;
export
default
{
name
:
"home"
,
data
()
{
...
...
Please
register
or
sign in
to post a comment