Commit 0e7e6280 authored by xxx's avatar xxx

1

parent 5e7a447f
......@@ -47,6 +47,9 @@
toJavaCoordinates:[],
controlPointId:0,
lineData:[],
weilanzuobianData:[],
weilanName:[],
areaColorData:[],
}
},
......@@ -90,6 +93,7 @@
methods: {
//后台获取数据
getCoordinate(data) {
let that = this;
this.zuobianData = data;
HttpReq.truckDispatching.apiPathmapQuery({size:9999}).then((res) => {
if(res.code == 200){
......@@ -117,11 +121,31 @@
arr1.push(obj1);
});
this.lineData = arr1;
//获取电子围栏
HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){;
let data1 = [];
for(let key in res){
that.weilanName.push(key);
that.areaColorData.push(res[key][0].color);
let arrays = [];
res[key].forEach(function(item){
var arr = [];
arr[0] = item.lon;
arr[1] = item.lat;
arr[2] = "500";
arrays.push(arr);
})
data1.push(arrays)
}
that.weilanzuobianData = data1
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
......@@ -130,6 +154,9 @@
})
}
})
}
})
})
}
})
......@@ -164,14 +191,12 @@
})
this.$nextTick(()=>{
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
})
}
})
......@@ -191,14 +216,12 @@
this.$nextTick(()=>{
if(res.code == 200){
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
}
})
})
......@@ -238,14 +261,12 @@
})
this.$nextTick(()=>{
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
})
}
})
......@@ -269,14 +290,12 @@
this.$nextTick(()=>{
if(res.code == 200){
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
}
})
})
......@@ -301,6 +320,14 @@
map = new mars3d.Map(`mars3d-container${this.mapKey}`, mapOptions)
this[`map${this.mapKey}`] = map
//围栏回显
that.weilanzuobianData.forEach(function(item,index){
var graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer);
initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index],that.areaColorData[index]);
})
//关键点显示
that.zuobianData.forEach(function(item,index){
var graphicLayer = new mars3d.layer.GraphicLayer();
......@@ -342,6 +369,28 @@
})
graphicLayer.addGraphic(graphic)
},
//围栏回显
addGraphic_01(graphicLayer,positions,weilanName,color){
let graphic = new mars3d.graphic.PolygonEntity({
positions: positions,
style: {
color: color,
opacity: 0.5,
outline: true,
outlineWidth: 3,
outlineColor: "#ffffff",
label: {
text: weilanName,
font_size: 18,
color: "#ffffff",
distanceDisplayCondition: true,
distanceDisplayCondition_far: 500000,
distanceDisplayCondition_near: 0,
},
},
});
graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
},
//画线
addDemoGraphic2(graphicLayer,item) {
const graphic = new mars3d.graphic.PolylineEntity({
......
......@@ -16,7 +16,7 @@
<el-input-number v-model="query.coefficient" :precision="2" :step="0.1" :min="0" :max="9999" @change="inputInitialFn()"></el-input-number>
<el-button size="mini" type="success" @click="addKeyPoints()" :disabled="addKeyPointsAble">添加路径关键点</el-button>
<div style="width:62vw;height: 72vh;overflow: hidden;margin-top: 1vh;">
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod"/>
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod" :key="shuaxinTimer"/>
</div>
</div>
</div>
......@@ -122,6 +122,8 @@ export default {
faControlPointId:0,
//选择连接点数据
selectConnectPointArray:[],
//重置地图
shuaxinTimer:null,
};
},
mounted(){
......@@ -440,6 +442,38 @@ export default {
})
}
},
//重置数据
resetData(){
//获取各个点的数据
HttpReq.truckDispatching.apiCpointQuery({size:9999}).then((res) => {
if(res.code == 200){
let arr1 = [];
res.data.content.forEach((item,index)=>{
let obj1 = {};
obj1.end = item.name;
obj1.weight = 0;
arr1.push(obj1);
})
this.controlPointData = arr1;
this.shuaxinTimer = new Date().getTime();
this.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content);
//添加路径关键点按钮可否使用
this.addKeyPointsAble = false;
//选择关键点类型
this.activeName = "";
//装卸车点名称
this.entruckingValue1 = [];
this.detrainingValue2 = [];
this.controlPointValue3 = '';
//保存时判断为添加还是修改
this.transmitWay = 'add';
//暂存修改删除时的id
this.faControlPointId = 0;
//选择连接点数据
this.selectConnectPointArray = [];
}
})
},
// 地图构造完成回调
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