This commit is contained in:
姚宇浩 2024-07-24 16:18:27 +08:00
parent 97c8e04edc
commit 1d35bfb512
1 changed files with 21 additions and 2 deletions

View File

@ -137,6 +137,7 @@ const cs_qk_arr = ref([]);
const cs_name_arr = ref([]);
const cs_number_name_arr = ref([]);
//
const jrcs=ref(false)
const title_choose = ref("龙游县");
//
const colorList = [
@ -168,6 +169,8 @@ const colorList = [
bg: "RGBA(27, 91, 55, 1)",
},
];
//
//
const center_now = ref([]);
const center_center = ref([119.178783, 29.034583]);
@ -404,8 +407,16 @@ const addPolygonCounty = () => {
map.addOverlay(polygon);
polygon.addEventListener("click", () => {
console.log(item.name);
if (title_choose.value.includes("溪口镇")) {
if(item.name !== "溪口镇"){
jrcs.value=false;
console.log( jrcs.value,'000');
}
if (jrcs.value && item.name !== "溪口镇") {
console.log(1);
} else {
console.log(2);
jrcs.value=true;
let jdCenter = [];
if (item.name == "溪口镇") {
if (!title_choose.value.includes("溪口镇")) {
@ -418,6 +429,7 @@ const addPolygonCounty = () => {
jdCenter = item.center;
}
});
console.log( jrcs.value);
addCs();
goMapCenter(jdCenter, 13);
} else {
@ -493,7 +505,13 @@ const addPolygonCountyCs = () => {
});
map.addOverlay(cs_qk_arr.value[index]);
cs_qk_arr.value[index].addEventListener("click", () => {
console.log(111);
console.log(item.name);
// console.log(111,xkzDk);
// xkzDk.forEach((itemm,indexx)=>{
// if(itemm.name==item.name){
// }
// })
// let jdCenter = [];
// if (item.name == "") {
// if (!title_choose.value.includes("")) {
@ -521,6 +539,7 @@ const addPolygonCountyCs = () => {
}
});
};
//
const createCustomOverlayJd = (polygon, indexx) => {