Commit f7e46e64 authored by xxx's avatar xxx

1

parent fd5b0fc0
......@@ -89,12 +89,13 @@ export default {
methods: {
//获取数据
getCoordinate(equipmentName,number,speed,bTime,eTime,stopPointData) {
getCoordinate(equipmentName,number,speed,bTime,eTime,stopPointData,leadTimeShow) {
let that = this;
that.deviceId = equipmentName;
that.carNumber = number;
that.carPlaySpeed = speed;
that.stopPointData = stopPointData;
that.leadTime = leadTimeShow;
//获取历史轨迹
if(number == ''){
return
......@@ -155,7 +156,6 @@ export default {
//创建地图电子围栏
initMars3d(options) {
let that = this;
//if (this[`map${this.mapKey}`]) return
const mapOptions = {
...options,
......@@ -222,6 +222,7 @@ export default {
color: "rgb(251,84,48)",
opacity: 1.0,
leadTime: that.leadTime ? 9999 : 0, // 前方的路线不显示
trailTime: that.leadTime ? 9999 : 0,
//高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight: {
type: mars3d.EventType.click,
......@@ -402,15 +403,16 @@ export default {
}
},
callback: (e) => {
const graphic = e.graphic
if (!graphic) {
return
}
const parent = graphic.parent // 右击是编辑点时
graphicLayer.removeGraphic(graphic)
if (parent) {
graphicLayer.removeGraphic(parent)
}
// const graphic = e.graphic
// if (!graphic) {
// return
// }
// const parent = graphic.parent // 右击是编辑点时
// graphicLayer.removeGraphic(graphic)
// if (parent) {
// graphicLayer.removeGraphic(parent)
// }
// map.removeLayer(graphicLayer);
}
},
// {
......
......@@ -54,6 +54,11 @@
</el-select>
</el-form-item>
<el-form-item label="" style="display: inline-block;">
<el-button type="primary" @click="trajectoryShow(true)" plain>显示所有轨迹</el-button>
<el-button type="primary" @click="trajectoryShow(false)" plain>关闭所有轨迹</el-button>
</el-form-item>
</el-form>
<div id="centerDiv" class="mapcontainer2">
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod" :key="shuaxinTimer"/>
......@@ -102,6 +107,7 @@ export default {
tishiTextShow:true,
trajectoryTableData:[],
measureDistanceDis:true,
leadTime:false,
}
},
mounted() {
......@@ -137,7 +143,7 @@ export default {
if(res.code == 200 && res.data.totalElements != 0){
this.tishiTextShow = false;
this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData);
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData,this.leadTime);
}else{
this.$notify({
title: '暂无该车辆轨迹信息!',
......@@ -186,7 +192,7 @@ export default {
this.measureDistanceDis = false;
this.trajectoryTableData = res1.data;
this.shuaxinTimer = new Date().getTime();
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData);
that.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content[0].equipmentName,res.data.content[0].number,that.playSpeedNum,that.query.bTime,that.query.eTime,this.trajectoryTableData,this.leadTime);
}
})
}else{
......@@ -214,7 +220,7 @@ export default {
this.loadData();
this.tishiTextShow = true;
this.shuaxinTimer = new Date().getTime();
this.$refs.mars3dViewerMapMethod.getCoordinate('','',5,'','',[]);
this.$refs.mars3dViewerMapMethod.getCoordinate('','',5,'','',[],this.leadTime);
this.measureDistanceDis = true;
},
//获取数据
......@@ -252,7 +258,7 @@ export default {
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,this.trajectoryTableData);
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);
}
})
}
......@@ -265,6 +271,22 @@ export default {
measureDistanceClose(){
this.$refs.mars3dViewerMapMethod.startDrawGraphic(false);
},
//轨迹显示与否
trajectoryShow(boo){
let that = this;
this.leadTime = boo;
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,that.playSpeedNum,that.query.bTime,that.query.eTime,that.trajectoryTableData,that.leadTime);
}
})
}
},
// 地图构造完成回调
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