From 95c5101b71dc0826b1878c2a9c4c988473f03492 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期六, 22 二月 2025 17:05:23 +0800 Subject: [PATCH] 地图bug和“亿”改成万元 --- src/views/components/Map/index.vue | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/views/components/Map/index.vue b/src/views/components/Map/index.vue index c81f182..2b838fd 100644 --- a/src/views/components/Map/index.vue +++ b/src/views/components/Map/index.vue @@ -40,7 +40,7 @@ export default { data() { return { - zoom: 15, + zoom: 11, map: null, contentRef: {}, infoWin: {}, @@ -144,7 +144,7 @@ //form琛ㄥ崟涓槸鍚︽湁鍧愭爣锛屾湁鍒欏畾浣嶅埌瀵瑰簲浣嶇疆锛屾病鏈夊垯浣跨敤榛樿鐨� // 104.65417 28.75572 娴嬭瘯鏁版嵁 // 鍥涘窛鐪佸疁瀹惧競缈犲睆鍖哄ぇ瑙傛ゼ琛楅亾澶栧崡琛�71 - if (this.$props.mapList[0].addr) { + if (this.$props.mapList.length>0&&this.$props.mapList[0].addr) { const { lng: lon, lat } = await this.getGeocode( this.$props.mapList[0].addr ); @@ -388,10 +388,10 @@ makeAllMask(mapList) { // 娓呴櫎涔嬪墠鐨勬爣璁� this.map && this.map.clearOverLays(); - var minX = mapList[0].longitude; - var maxX = mapList[0].longitude; - var minY = mapList[0].latitude; - var maxY = mapList[0].latitude; + var minX = 180; + var maxX = -180; + var minY = 90; + var maxY = -90; var _this = this; mapList.map((item) => { const config = { @@ -412,7 +412,9 @@ projectAddr: item.projectAddress, projectStatus: item.usedStatus, }; + _this.makeMask(item.longitude, item.latitude, config); + if (item.longitude && item.longitude > maxX) { maxX = item.longitude; } @@ -426,6 +428,7 @@ minY = item.latitude; } }); + this.moveTo( (parseFloat(maxX) + parseFloat(minX)) / 2, (parseFloat(maxY) + parseFloat(minY)) / 2 -- Gitblit v1.8.0