diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 7d8fc0b..9c52a01 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -1818,6 +1818,29 @@ const clear = () => { xkzCenter.length = 0; xkzDk.length = 0; }; +//清空选中年龄及标签(街道级别) +const clearPerson=()=>{ + if(choose.value.person){ + choose.value.person=''; + jdm_number_arr.value.forEach((item, index) => { + map.removeOverlay(jdm_number_arr.value[index]); + }); + addJd(); + } +} +//清空要素 +const clearyaosu=()=>{ + + if(yaosuList.value.length!=0){ + yaosuList.value.forEach((name,index)=>{ + yaosuIcon.value[name].sj.forEach((item, index) => { + map.removeOverlay(yaosuIcon.value[name].sj[index].overlay); + }); + }) + yaosuList.value.length=0; + } + +} //定义地图中点 const goMapCenter = (point, zoom) => { map.centerAndZoom(new BMapGL.Point(point[0], point[1]), zoom); @@ -1898,6 +1921,7 @@ const buten = async (item) => { } } else { loadingss.value = true; + clearyaosu(); await getData(item.age); await getDatasL(cfJd.value, item.age); loadingss.value = false; @@ -1938,6 +1962,7 @@ const buten2 = async (item) => { } } else { loadingss.value = true; + clearyaosu(); await getDataBqs(cfJd.value, cfCs.value, item.id); loadingss.value = false; } @@ -2690,6 +2715,8 @@ const changeys = (name) => { map.removeOverlay(yaosuIcon.value[name].sj[index].overlay); }); } else { + csh(); + clearPerson(); yaosuList.value.push(name); let url; let img; @@ -3097,6 +3124,7 @@ const changeFwq = async (id, name, names) => { // circle = null; } else { csh(); + clearPerson(); await loadCs(name); await getServiceCircle(names, name); if (fwqList.value.length !== 0) { @@ -3662,6 +3690,9 @@ const addPolygonCounty = () => { // townName.value = item.name; if (item.name == cfJd.value) { } else { + if(yaosuList.value.length!=0){ + return + } loadingss.value = true; clear(); xkzDk.length = 0;