Commit 79980e0f authored by yaqizhang's avatar yaqizhang

大屏

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