From 35a0c77a631df4e843a1e80ed98fe14fb2a02884 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期一, 24 三月 2025 11:48:28 +0800 Subject: [PATCH] Merge branch 'dev' --- src/views/components/Map/index.vue | 32 ++++++++++++++------------------ 1 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/views/components/Map/index.vue b/src/views/components/Map/index.vue index c81f182..f59eef7 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 ); @@ -281,17 +281,10 @@ }, showProjectStatusStr(status) { switch (status) { - case "1": - return "鍌ㄥ椤圭洰"; - case "2": - return "鍓嶆湡椤圭洰"; - case "3": - return "瀹炴柦椤圭洰"; - case "4": - return "绔e伐椤圭洰"; - case "5": - return "寮傚父椤圭洰"; - + case "pendding": + return "鏈紑宸�"; + case "working": + return "宸插紑宸�"; default: return "寮傚父椤圭洰"; } @@ -388,10 +381,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 = { @@ -410,9 +403,11 @@ ? item.yearInvestAmount + "鍏�" : "鏆傛棤鏁版嵁", projectAddr: item.projectAddress, - projectStatus: item.usedStatus, + projectStatus: item.projectStatus, }; + _this.makeMask(item.longitude, item.latitude, config); + if (item.longitude && item.longitude > maxX) { maxX = item.longitude; } @@ -426,6 +421,7 @@ minY = item.latitude; } }); + this.moveTo( (parseFloat(maxX) + parseFloat(minX)) / 2, (parseFloat(maxY) + parseFloat(minY)) / 2 -- Gitblit v1.8.0