From 9d389dee9dfb78bf4a57ff41ba11d61c65134442 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 19 Dec 2025 14:13:42 +0800
Subject: [PATCH] 地图修改

---
 src/views/bigScreen/components/map.vue |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/views/bigScreen/components/map.vue b/src/views/bigScreen/components/map.vue
index 7875851..9a5a947 100644
--- a/src/views/bigScreen/components/map.vue
+++ b/src/views/bigScreen/components/map.vue
@@ -1,5 +1,5 @@
 <template>
-  <baidu-map class="bigMap" ref="map" ak="Z4tYehNEVsdeMw3Mjspdn77pV50ffc8t" @zoomend="zoomMap" v="3.0" type="API" :scroll-wheel-zoom="true" :center="{lng: 87.681678, lat: 43.943557}" :zoom="18" map-type="BMAP_SATELLITE_MAP" @ready="initMap">
+  <baidu-map class="bigMap" ref="map" ak="Z4tYehNEVsdeMw3Mjspdn77pV50ffc8t" v="3.0" @zoomend="zoomMap" type="API" :scroll-wheel-zoom="true" :center="{lng: 87.681678, lat: 43.943557}" :zoom="18" map-type="BMAP_SATELLITE_MAP" @ready="initMap">
         <bm-overlay pane="mapPane" class="polys" @draw="initMap">
           <bm-polygon :path="polygonPath1" stroke-color="yellow" fillColor="yellow" :fillOpacity="0.7" :stroke-weight="2" :zIndex="2"/>
           <bm-label content="1" :position="{lng: 87.679807, lat: 43.94402 }" :labelStyle="tittleStyle" title="1" :zIndex="3"/>
@@ -58,7 +58,7 @@
 import screen from './components/screen.vue'
 import screenfull from 'screenfull'
 import { ElMessage, ElMessageBox } from 'element-plus';
-import {BaiduMap, BmOverlay, BmGround, BmMapType, BmNavigation, BmPolygon, BmLabel, BmPolyline} from 'vue-baidu-map-3x'
+// import {BaiduMap, BmOverlay, BmGround, BmMapType, BmNavigation, BmPolygon, BmLabel, BmPolyline} from 'vue-baidu-map-3x'
 
 // 定义接口来定义对象的类型
 interface TableDataState {
@@ -78,7 +78,6 @@
   polylinePath21: Array<location>
   polylinePath22: Array<location>
   textStyle: {}
-  textStyle2: {}
   tittleStyle: {}
   numberStyle: {}
 }
@@ -88,7 +87,7 @@
 }
 export default defineComponent({
   name: 'map',
-  components: {BaiduMap, BmOverlay, BmGround, BmMapType, BmNavigation, BmPolygon, BmLabel, BmPolyline },
+  // components: {BaiduMap, BmOverlay, BmGround, BmMapType, BmNavigation, BmPolygon, BmLabel, BmPolyline },
   setup() {
     const state = reactive<TableDataState>({
       polygonPath1: [],
@@ -111,12 +110,6 @@
         fontSize : '16px',
         backgroundColor: 'rgba(0,0,0,0)',
         borderColor: '#fff'
-      },
-      textStyle2: {
-        color: 'red',
-        fontSize : '16px',
-        backgroundColor: 'rgba(0,0,0,0)',
-        borderColor: 'red'
       },
       tittleStyle: {
         color: '#000000',
@@ -164,21 +157,20 @@
       state.polylinePath2 = [{ lng: 87.681000, lat: 43.942226}, {lng: 87.680323, lat: 43.943302}]
       state.polylinePath21 = [{lng: 87.680323, lat: 43.943302},{ lng: 87.680303, lat: 43.943202}]
       state.polylinePath22 = [{lng: 87.680323, lat: 43.943302},{ lng: 87.680453, lat: 43.943242}]
+
     }
-    const zoomMap = (type, target)=>{
-      if(type.target.Za>=18){
+    const zoomMap = (e)=>{
+      const zoom = e.target.getZoom()
+      if(zoom>=18){
         state.textStyle.fontSize = '16px'
-        state.textStyle2.fontSize = '16px'
         state.tittleStyle.fontSize = '20px'
         state.numberStyle.fontSize = '16px'
-      }else if(type.target.Za>=15 && type.target.Za<=17){
+      }else if(zoom>=15 && zoom<=17){
         state.textStyle.fontSize = '12px'
-        state.textStyle2.fontSize = '12px'
         state.tittleStyle.fontSize = '14px'
         state.numberStyle.fontSize = '12px'
       }else{
         state.textStyle.fontSize = '10px'
-        state.textStyle2.fontSize = '10px'
         state.tittleStyle.fontSize = '10px'
         state.numberStyle.fontSize = '10px'
       }
@@ -224,4 +216,4 @@
   text-align: center;
   padding: 10px;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.2