From 803b93038ca16e21ea60a260ca4ac882b84a87ef Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 18 七月 2025 17:31:53 +0800
Subject: [PATCH] 2025.7.18 监管任务模块 1. 监管场景样式优化; 2. 新增监管场景GIS地图展示(待完成);

---
 src/components/map/SceneMap.vue |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/components/map/SceneMap.vue b/src/components/map/SceneMap.vue
index 60e7038..7994a7f 100644
--- a/src/components/map/SceneMap.vue
+++ b/src/components/map/SceneMap.vue
@@ -1,12 +1,42 @@
 <template>
-  <div style="width: 70vw; height: 500px; background-color: aliceblue">
-    <BaseMap></BaseMap>
-  </div>
+  <BaseMap></BaseMap>
 </template>
 <script setup>
+import { watch } from 'vue';
+import { map, onMapMounted } from '@/utils/map/index';
+import marks from '@/utils/map/marks';
+import { sceneIcon } from '@/assets/scene-icon';
 const props = defineProps({
   // 鍦烘櫙鐐逛綅淇℃伅
   data: Array
 });
+
+var markViewList = [];
+
+watch(
+  () => props.data,
+  (nV, oV) => {
+    if (nV != oV) {
+      drawSceneMarks();
+    }
+  },
+  { immediate: true }
+);
+
+function drawSceneMarks() {
+  onMapMounted(() => {
+    markViewList = [];
+    props.data.forEach((d) => {
+      const mark = marks.createMarker({
+        position: [d.longitude, d.latitude],
+        icon: sceneIcon(d.typeid),
+        label: d.name,
+        extData: d.guid
+      });
+      markViewList.push(mark);
+    });
+    map.setFitView(markViewList);
+  });
+}
 </script>
 <style scoped></style>

--
Gitblit v1.9.3