diff --git a/src/view/sy_mapcopy.vue b/src/view/sy_mapcopy.vue index 7b0faa7..1e3e668 100644 --- a/src/view/sy_mapcopy.vue +++ b/src/view/sy_mapcopy.vue @@ -119,7 +119,7 @@ v-for="(item, index) in jbfwqTotal" :key="index" > -
{{ item.name}}
+
{{ item.name }}
{ const changeys = (name) => { if (yaosuList.value.includes(name)) { yaosuList.value = yaosuList.value.filter((ch) => ch !== name); + // yaosuIcon.value[name].sj.forEach((item, index) => { + // map.removeOverlay( yaosuIcon.value[name].sj[index]); + // }); } else { yaosuList.value.push(name); - yaosuIcon.value.forEach((item,index)=>{ - createZyys() - }) + // getZyys(name); } - // yaosuList.value = removeCharFromArray(yaosuList.value, name); +}; +const getZyys = (name) => { + http.get(``).then((res) => { + if (res.code == 200) { + res.data.map((item, index) => { + createZyys(item, index, name); + }); + } + }); }; // 添加资源要素的图标 -const createZyys = (polygon, indexx) => { +const createZyys = (polygon, indexx, name) => { // data.fwqCoordinates = polygon.point; function createLabelDOM() { var content = document.createElement("div"); @@ -1851,7 +1860,7 @@ const createZyys = (polygon, indexx) => { content.appendChild(img2); return content; } - fwq_list_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, { + yaosuIcon.value[name].sj[indexx] = new BMapGL.CustomOverlay(createLabelDOM, { point: new BMapGL.Point(...polygon.point), opacity: 0.5, offsetY: -10, @@ -1860,7 +1869,7 @@ const createZyys = (polygon, indexx) => { type: "customOverlay", }, }); - map.addOverlay(fwq_list_arr.value[indexx]); + map.addOverlay(yaosuIcon.value[name].sj[indexx]); }; //----------资源要素------------ //点击街道,回到街道 @@ -2061,7 +2070,7 @@ const changeFwq = async (id, name, names) => { ); //中心点缩放 }, 500); } else { - console.log('无数据11'); + console.log("无数据11"); ElMessage.warning("无数据"); } } @@ -2183,7 +2192,7 @@ const addggfwq = () => { // console.log("最大距离:", maxDistance,data.zoomLevel); drawACircle(maxDistance); } else { - ElMessage.warning("无数据"); + ElMessage.warning("无数据"); } }; //计算两点之间直线距离