Commit fce42eb1 authored by lizhichao's avatar lizhichao

Merge branch 'master' of ssh://111.61.77.35:15/lizhichao/whp-xl

parents a2a6ab23 79980e0f
......@@ -143,8 +143,12 @@ export default class GIS extends Vue {
};
/* 地图 */
@Provide() markers: any = [];
@Provide() markers1: any = [];
@Provide() markers2: any = [];
@Provide() mapData: any = [];
@Provide() windowsArr: any = [];
@Provide() windowsArr1: any = [];
@Provide() windowsArr2: any = [];
@Provide() currentWindow: any = "";
// @Provide() searchOption: any = {
// city: "石家庄",
......@@ -310,9 +314,11 @@ export default class GIS extends Vue {
events: {
click: (e: any) => {
that.windowsArr.forEach((ele: any) => {
// console.log(ele,"ele")
ele.visible = false;
});
that.$nextTick(() => {
// console.log(ele,"ele")
that.currentWindow = that.windowsArr[index];
that.currentWindow.visible = true;
});
......@@ -343,11 +349,11 @@ export default class GIS extends Vue {
offset: [-13, -2],
events: {
click: (e: any) => {
that.windowsArr.forEach((ele: any) => {
that.windowsArr1.forEach((ele: any) => {
ele.visible = false;
});
that.$nextTick(() => {
that.currentWindow = that.windowsArr[index];
that.currentWindow = that.windowsArr1[index];
that.currentWindow.visible = true;
});
},
......@@ -377,11 +383,11 @@ export default class GIS extends Vue {
offset: [-13, -2],
events: {
click: (e: any) => {
that.windowsArr.forEach((ele: any) => {
that.windowsArr2.forEach((ele: any) => {
ele.visible = false;
});
that.$nextTick(() => {
that.currentWindow = that.windowsArr[index];
that.currentWindow = that.windowsArr2[index];
that.currentWindow.visible = true;
});
},
......@@ -406,6 +412,20 @@ export default class GIS extends Vue {
that.markers[index].visible = false;
}
});
that.wxymapData.forEach((ele: any, index: any) => {
if (ele.dataType == v || v == 0) {
that.markers1[index].visible = true;
} else {
that.markers1[index].visible = false;
}
});
that.shipinmapData.forEach((ele: any, index: any) => {
if (ele.dataType == v || v == 0) {
that.markers2[index].visible = true;
} else {
that.markers2[index].visible = false;
}
});
}
/* 搜索 */
......@@ -539,38 +559,38 @@ export default class GIS extends Vue {
// });
if (res.code == 0 && res.data.goodsList.length > 0) {
that.mapData = res.data.goodsList;
let latSum = 0;
let lngSum = 0;
that.mapData.forEach((ele: any, index: any) => {
that.wxymapData = res.data.goodsList;
let wxylatSum = 0;
let wxylngSum = 0;
that.wxymapData.forEach((ele: any, index: any) => {
that.wxyaddMark(ele, index);
lngSum += ele.longitude;
latSum += ele.latitude;
wxylngSum += ele.longitude;
wxylatSum += ele.latitude;
});
let center = [
lngSum / that.mapData.length,
latSum / that.mapData.length,
wxylngSum / that.wxymapData.length,
wxylatSum / that.wxymapData.length,
];
that.Mutil.setViewF({
center: center
})
}
if (res.code == 0 && res.data.cameraList.length > 0) {
let shipinmapData = res.data.cameraList;
that.shipinmapData = res.data.cameraList;
let shipinlatSum = 0;
let shipinlngSum = 0;
shipinmapData.forEach((ele: any, index: any) => {
that.shipinmapData.forEach((ele: any, index: any) => {
that.shipinaddMark(ele, index);
shipinlngSum += ele.longitude;
shipinlatSum += ele.latitude;
});
// let center = [
// shipinlngSum / that.shipinmapData.length,
// shipinlatSum / that.shipinmapData.length,
// ];
// that.Mutil.setViewF({
// center: center
// })
let center = [
shipinlngSum / that.shipinmapData.length,
shipinlatSum / that.shipinmapData.length,
];
that.Mutil.setViewF({
center: center
})
}
}
}
......
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