From 01b4b781876e3ded3a99bcf9b3d1fc3b98525138 Mon Sep 17 00:00:00 2001 From: yaoyuhao Date: Mon, 30 Sep 2024 13:49:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/dialog/echarts/map.vue | 11 +++++++++-- src/view/echart_analyze/map.vue | 18 ++++++++++++------ src/view/sy_map.vue | 22 ++++++---------------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/view/dialog/echarts/map.vue b/src/view/dialog/echarts/map.vue index ed4db40..c157b6d 100644 --- a/src/view/dialog/echarts/map.vue +++ b/src/view/dialog/echarts/map.vue @@ -7,7 +7,8 @@ import { onMounted, reactive, nextTick, ref, defineProps, watch } from "vue"; // import mapTown from '@/assets/json/330225.json' import m1 from "@/assets/images/map/m1.png"; import m2 from "@/assets/images/map/m2.png"; -import mapTown from '@/assets/json/ly.json' +import mapTown from '@/assets/json/ly.json'; +import tools from "@/utils/tools"; let map = null; // 点位 const mapTownCount = reactive([ @@ -93,9 +94,15 @@ const mapTownDataDK = reactive([]); const initMap = () => { map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 16 }); map.enableScrollWheelZoom(true); - map.setMapStyleV2({ + let type = tools.data.get("type"); + if(type==1){ + + }else{ + map.setMapStyleV2({ styleId: "d0acde891abd157741b71e12670ee2e6", }); + } + goMapCenter([119.123203, 29.098722], 12); loadTown(); diff --git a/src/view/echart_analyze/map.vue b/src/view/echart_analyze/map.vue index f9ba261..543d336 100644 --- a/src/view/echart_analyze/map.vue +++ b/src/view/echart_analyze/map.vue @@ -12,17 +12,23 @@ import { defineProps, watch, } from "vue"; +import tools from "@/utils/tools"; var map = null; const initMap = () => { map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 20 }); map.enableScrollWheelZoom(true); - // map.setMapStyleV2({ - // styleId: "d0acde891abd157741b71e12670ee2e6", - // }); + + let type = tools.data.get("type"); + if (type == 1) { + } else { + map.setMapStyleV2({ + styleId: "d0acde891abd157741b71e12670ee2e6", + }); + } goMapCenter([119.178783, 29.034583], 15); - // 开启交通流量图层 - // map.addTileLayer(new BMapGL.TrafficLayer()); - map.setTrafficOn(); // 添加交通流量图层 + // 开启交通流量图层 + // map.addTileLayer(new BMapGL.TrafficLayer()); + map.setTrafficOn(); // 添加交通流量图层 }; //地图中点 diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 983efdd..d2c80f8 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -1860,7 +1860,7 @@ const buten = async (item) => { }); addJd(); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (sfdd.value) { // cs_dd_arr.value.forEach((item, index) => { @@ -1900,7 +1900,7 @@ const buten2 = async (item) => { }); addJd(); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (sfdd.value) { // cs_dd_arr.value.forEach((item, index) => { @@ -2045,7 +2045,7 @@ const getDatasL = async (e, i) => { cs_dd_arr.value.forEach((item, index) => { map.removeOverlay(cs_dd_arr.value[index]); }); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (cfCs.value) { cs_dd_arr.value = [...xuanzhongCs.value]; @@ -2163,7 +2163,7 @@ const getDatas = async (e, i, y = true) => { map.removeOverlay(cs_dd_arr.value[index]); }); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (sfdd.value) { if (choose.value.person == "") { @@ -2478,7 +2478,7 @@ const getDataBqs2 = async (jd, cs, bq) => { cs_dd_arr.value.forEach((item, index) => { map.removeOverlay(cs_dd_arr.value[index]); }); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (sfdd.value) { // if (choose.value.person == "") { @@ -2588,7 +2588,7 @@ const getDataBqs4 = async (jd, cs, bq) => { cs_dd_arr.value.forEach((item, index) => { map.removeOverlay(cs_dd_arr.value[index]); }); - if (title_jd.value == "") { + if (cfJd.value == "") { } else { if (sfdd.value) { if (choose.value.person == "") { @@ -3628,7 +3628,6 @@ const addPolygonCounty = () => { // townName.value = item.name; if (item.name == cfJd.value) { } else { - console.log('街道1'); loadingss.value = true; clear(); xkzDk.length = 0; @@ -3643,20 +3642,16 @@ const addPolygonCounty = () => { } }); goMapCenter(jdCenter, 13); - console.log('街道2'); await getDataBq(cfJd.value, ""); if (choose.value.person == "") { - console.log('街道3'); await getDatas(cfJd.value, ""); loadingss.value = false; } if (tsbq_pp.value.includes(choose.value.person)) { - console.log('街道4'); await getDatas(cfJd.value, "", false); //使用await把loading放外面,没效果,所以把loading放接口里面 getDataBqs4(cfJd.value, cfCs.value, choose.value.person); } else if (choose.value.person != "") { - console.log('街道5'); if (choose.value.person == "9999") { await getDatas(cfJd.value, ""); loadingss.value = false; @@ -3667,9 +3662,7 @@ const addPolygonCounty = () => { } if (title_jd.value == item.name) { } else { - console.log('街道6'); setTimeout(() => { - console.log('街道7'); title_jd.value = item.name; },1000) @@ -3878,15 +3871,12 @@ const addPolygonCountyCs = () => { }); map.addOverlay(cs_qk_arr.value[index]); cs_qk_arr.value[index].addEventListener("click", async () => { - console.log('村社1'); if (drawing.value) { return; } if(!title_jd.value){ - console.log('村社2'); return } - console.log('村社3'); loadingss.value = true; cs_dd_arr.value = []; xuanzhongCs.value = [];