Commit d0345395 authored by xxx's avatar xxx

1

parent 43ac3573
......@@ -28,6 +28,7 @@ Vue.prototype.Cesium = mars3d.Cesium
var map;
//画测距属性
var graphicLayerPolyline;
var currentTimeInterval = null;
export default {
name: 'mars3dViewer',
......@@ -94,7 +95,6 @@ export default {
that.deviceId = equipmentName;
that.carNumber = number;
that.carPlaySpeed = speed;
console.log(that.carPlaySpeed);
that.stopPointData = stopPointData;
that.leadTime = leadTimeShow;
//获取历史轨迹
......@@ -168,7 +168,7 @@ export default {
"vrButton": false,
"fullscreenButton": true,
"navigationHelpButton": true,
"animation": true,
"animation": false,
"timeline": false,
"infoBox": false,
"geocoder": false,
......@@ -196,7 +196,8 @@ export default {
scene:{
"clock":{
currentTime: that.currentTime1(that.historyTrajectoryData[0].arrays[0][3]),
shouldAnimate: true
shouldAnimate: true,
multiplier:1,
},
"center": {"lat":37.4900,"lng":122.04849,"alt":1000,"heading":360,"pitch":-90},
"scene3DOnly": false,
......@@ -258,9 +259,9 @@ export default {
})
//画测距
graphicLayerPolyline = new mars3d.layer.GraphicLayer();
//graphicLayerPolyline = new mars3d.layer.GraphicLayer();
//that.bindLayerContextMenu(graphicLayerPolyline);
map.addLayer(graphicLayerPolyline);
//map.addLayer(graphicLayerPolyline);
// 抛出事件
this.$emit('onload', map)
......@@ -278,6 +279,11 @@ export default {
property.addSample(tempTime, Cesium.Cartesian3.fromDegrees(positions[i][0],positions[i][1],positions[i][2]));
}
//将当前进度时间传给父组件
currentTimeInterval = setInterval(function(){
that.$parent.progressTimeFn(that.currentTime1(map.clock.currentTime));
},1000)
var graphic = new mars3d.graphic.PathEntity({
position: property,
style: {
......@@ -471,7 +477,6 @@ export default {
// text: "计算长度",
// icon: "fa fa-medium",
// callback: (e) => {
// console.log(e);
// const graphic = e.graphic
// const strDis = mars3d.MeasureUtil.formatDistance(graphic.distance)
// alert("该对象的长度为:" + strDis)
......@@ -539,8 +544,22 @@ export default {
}
//获取当前系统时间 格式(yyyy-mm-dd hh:mm:ss)
let currentFormatDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
//console.log(currentFormatDate);
return currentFormatDate;
},
//暂停继续
pauseResume(boo){
map.clock.shouldAnimate = boo;
},
//改变倍速
changeSpeed(num){
map.clock.multiplier = parseInt(num);
},
//清除定时器
closeInterval(){
if(currentTimeInterval){
clearInterval(currentTimeInterval)
currentTimeInterval = null;
}
}
}
}
......
......@@ -34,8 +34,8 @@
</el-select>
</el-form-item>
<el-button style="display: inline-block;">暂停</el-button>
<el-button style="display: inline-block;">继续</el-button>
<el-button style="display: inline-block;" @click="pauseResume(false)">暂停</el-button>
<el-button style="display: inline-block;" @click="pauseResume(true)">继续</el-button>
<el-button type="primary" @click="changeSpeed(1)" plain>1倍</el-button>
<el-button type="primary" @click="changeSpeed(4)" plain>4倍</el-button>
<el-button type="primary" @click="changeSpeed(8)" plain>8倍</el-button>
......@@ -216,6 +216,7 @@ export default {
this.loadData();
this.tishiTextShow = true;
this.shuaxinTimer = new Date().getTime();
this.$refs.mars3dViewerMapMethod.closeInterval();
this.$refs.mars3dViewerMapMethod.getCoordinate('','',1,'','',[],this.leadTime);
this.measureDistanceDis = true;
},
......@@ -255,20 +256,7 @@ export default {
},
//改变倍速
changeSpeed(num){
let that = this;
let numSpeed1 = parseFloat(num);
this.playSpeedNum = parseFloat(num);
if(this.query.number == '' || this.query.bTime == '' || this.query.eTime == ''){
return;
}else{
HttpReq.truckDispatching.carInformationQuery({number:this.query.number}).then((res) => {
if(res.code == 200){
this.tishiTextShow = false;
this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,parseFloat(numSpeed1),that.query.bTime,that.query.eTime,that.trajectoryTableData,that.leadTime);
}
})
}
this.$refs.mars3dViewerMapMethod.changeSpeed(num);
},
//开测量距离
measureDistance(){
......@@ -302,6 +290,14 @@ export default {
this.query.number = '';
}
},
//暂停继续
pauseResume(boo){
this.$refs.mars3dViewerMapMethod.pauseResume(boo);
},
//接收当前进度时间
progressTimeFn(time){
console.log(time);
},
// 地图构造完成回调
onMapload(map) {
// 以下为演示代码
......
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