diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 4ed4915..5d54dfc 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -905,24 +905,24 @@ const yaosuTotal = ref([ const yaosuList = ref([]); //选中资源要素坐标 const yaosuIcon = ref({ - 摄像头: { - sj: [], - }, - 体育场所: { - sj: [], - }, - 幼儿园: { - sj: [], - }, - 小学: { sj: [] }, - 初中: { sj: [] }, - 高中: { sj: [] }, - 医院: { sj: [] }, - 南孔书院: { sj: [] }, - 养老机构: { sj: [] }, - 汽车充电桩: { sj: [] }, - 卫生服务中心: { sj: [] }, - AED: { sj: [] }, + // 摄像头: { + // sj: [], + // }, + // 体育场所: { + // sj: [], + // }, + // 幼儿园: { + // sj: [], + // }, + // 小学: { sj: [] }, + // 初中: { sj: [] }, + // 高中: { sj: [] }, + // 医院: { sj: [] }, + // 南孔书院: { sj: [] }, + // 养老机构: { sj: [] }, + // 汽车充电桩: { sj: [] }, + // 卫生服务中心: { sj: [] }, + // AED: { sj: [] }, }); //养老机构数据 const ylCount = reactive([ @@ -1076,7 +1076,7 @@ const pagination = reactive({ //--------定义方法---------------------------------------- //地图初始化 const initMap = () => { - map = new BMapGL.Map("map", { minZoom: 8, maxZoom: 19 }); + map = new BMapGL.Map("map", { minZoom: 8, maxZoom: 20 }); map.setMapType(BMAP_SATELLITE_MAP); map.enableScrollWheelZoom(true); goMapCenter([119.178783, 29.034583], 11); @@ -1094,8 +1094,6 @@ const getXzsj = async () => { .get("/api/ggfwyth/regionalDivision/getManagerTownDetails") .then((res) => { if (res.code == 200) { - console.log(JSON.parse(res.data)); - mapTown = JSON.parse(res.data); } }); @@ -2680,21 +2678,30 @@ const changeys = (name) => { tooltip = item.tooltip; } }); - if (name == "摄像头" || name == "AED" || name=='幼儿园' || name=='小学'|| name=='初中' || name=='高中'|| name=='医院') { + if ( + name == "摄像头" || + name == "AED" || + name == "幼儿园" || + name == "小学" || + name == "初中" || + name == "高中" || + name == "医院" + ) { getZyys(url, name, img, img_map, tooltip); } if (name == "养老机构") { getZyys2(name, img, img_map, tooltip); } - } }; //线上接口资源要素 const getZyys = (url, name, img, img_map, tooltip) => { http.get(url).then((res) => { if (res.code == 200) { - yaosuIcon.value[name].sj = res.data; - yaosuIcon.value[name].sj.forEach((item, index) => { + yaosuIcon.value[name] = {}; + yaosuIcon.value[name]["sj"] = []; + yaosuIcon.value[name]["sj"] = res.data; + yaosuIcon.value[name]["sj"].forEach((item, index) => { item.img = img; item.img_map = img_map; item.overlay = null; @@ -2727,8 +2734,10 @@ const getZyys = (url, name, img, img_map, tooltip) => { //本地存储资源要素 const getZyys2 = (name, img, img_map, tooltip) => { if (name == "养老机构") { - yaosuIcon.value[name].sj = ylCount; - yaosuIcon.value[name].sj.forEach((item, index) => { + yaosuIcon.value[name] = {}; + yaosuIcon.value[name]["sj"] = []; + yaosuIcon.value[name]["sj"] = ylCount; + yaosuIcon.value[name]["sj"].forEach((item, index) => { item.img = img; item.img_map = img_map; item.overlay = null; @@ -3251,7 +3260,7 @@ const createCustomOverlay = (polygon, indexx) => { function createLabelDOM() { var content = document.createElement("div"); content.style.display = "flex"; - content.style.justifyContent= "end"; + content.style.justifyContent = "end"; content.style.flexDirection = "column"; content.style.alignItems = "center"; content.style.justifyContent = "end";