3a1f7960 by unknown

'20191212'

1 parent a3e46c8c
......@@ -4,7 +4,7 @@
* @Author: jiangbotao
* @Date: 2019-12-07 14:24:01
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-10 10:17:09
* @LastEditTime: 2019-12-12 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.2504663970958063e-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
......
......@@ -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>
......
......@@ -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>
......
......@@ -2,7 +2,7 @@
* @Author: jiangbotao
* @Date: 2019-12-03 22:31:08
* @LastEditors: jiangbotao
* @LastEditTime: 2019-12-10 11:23:56
* @LastEditTime: 2019-12-12 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() {
......