From ae6a2de2c1224fde71a3ad944fb2f5091c59fd73 Mon Sep 17 00:00:00 2001 From: luojie Date: Thu, 19 Oct 2023 19:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AE=BE=E5=A4=87=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E4=BD=8D=E7=BD=AE=E5=92=8C=E5=91=8A=E8=AD=A6=E7=82=B9?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hd-glasses-app/README.md | 2 ++ hd-glasses-app/src/pages/hd_map.vue | 42 ++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/hd-glasses-app/README.md b/hd-glasses-app/README.md index d59417f..43b3939 100644 --- a/hd-glasses-app/README.md +++ b/hd-glasses-app/README.md @@ -1,5 +1,7 @@ +- Vue2脚手架搭建项目流程(脚手架、sass、router、vant、axiso、vuex) https://blog.csdn.net/weixin_53934815/article/details/129093796 +- Vue2创建移动端项目实战教程,创建移动端项目保姆级教程,接上一篇创建Vue2项目 https://blog.csdn.net/qq_51055690/article/details/126948901 https://blog.csdn.net/qq_40323256/article/details/120019157 diff --git a/hd-glasses-app/src/pages/hd_map.vue b/hd-glasses-app/src/pages/hd_map.vue index 47d9032..abb09aa 100644 --- a/hd-glasses-app/src/pages/hd_map.vue +++ b/hd-glasses-app/src/pages/hd_map.vue @@ -34,7 +34,7 @@ import * as interaction from 'ol/interaction'; // 交互 import {OL as ol} from "plot-ol/plottingol"; import GeoJSON from 'ol/format/GeoJSON' import service from "@/utils/service"; -import {appInit,getStatisFileUrl} from "../utils/publicFun"; +import {appInit, getStatisFileUrl} from "../utils/publicFun"; export default { data() { @@ -81,7 +81,9 @@ export default { drawPlanningPathLayer: null, draw: null, snap: null, - pcDrawType: "" + pcDrawType: "", + equipmentLayer: {}, + alarmLayer: {} }; }, mounted() { @@ -459,10 +461,10 @@ export default { }) .catch(() => { - // on cancel - this.drawPlanningPathLayer.getSource().clear(); - // this.map.removeLayer(this.drawPlanningPathLayer) - // this.map.addLayer(this.drawPlanningPathLayer) + // on cancel + this.drawPlanningPathLayer.getSource().clear(); + // this.map.removeLayer(this.drawPlanningPathLayer) + // this.map.addLayer(this.drawPlanningPathLayer) }); // this.map.removeInteraction(draw); // 在此处清除交互会触发地图默认的双击放大 }); @@ -477,6 +479,18 @@ export default { pageNo: 1, pageSize: 50 } + }).then((res) => { + if (res.status == 200) { + res.data.result.records.map(record => { + try { + if (record.leastLocation.length > 0) { + this.map.removeInteraction(record.leastLocation, "equipment") + } + } catch (e) { + console.error(e) + } + }) + } }) }, queryAlarmList() { @@ -486,10 +500,26 @@ export default { pageNo: 1, pageSize: 50 } + }).then((res) => { + if (res.status == 200) { + res.data.result.records.map(record => { + try { + if (record.location.length > 0) { + this.map.removeInteraction(record.location, "alarm") + } + } catch (e) { + console.error(e) + } + }) + } + }) }, switchFullScreen() { location.href = "uniwebview://action?function=switchBigScreen" + }, + addPointWidthCoordinate(coordinate, type) { + console.log("addPointWidthCoordinate", type, coordinate) } }, };