This commit is contained in:
duanxiaohai 2024-07-26 15:06:21 +08:00
parent c037d3600b
commit dd22037c11
3 changed files with 80 additions and 20 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -6,7 +6,8 @@
<div class="lyx"> <div class="lyx">
<div class="title"> <div class="title">
<div class="title_name"> <div class="title_name">
<span @click="csh()">龙游县</span>{{ title_choose }} <span @click="csh()">龙游县</span>
<span>{{ title_choose }}</span>
</div> </div>
<div class="title_line"></div> <div class="title_line"></div>
</div> </div>
@ -102,6 +103,7 @@ import {
watch, watch,
nextTick, nextTick,
} from "vue"; } from "vue";
import http from "@/utils/request.js";
import mapTown from "@/assets/json/ly.json"; import mapTown from "@/assets/json/ly.json";
import xkz from "@/assets/json/xkz.json"; import xkz from "@/assets/json/xkz.json";
import j0 from "@/assets/images/map/j0.png"; import j0 from "@/assets/images/map/j0.png";
@ -115,8 +117,6 @@ import j7 from "@/assets/images/map/j7.png";
import j8 from "@/assets/images/map/j8.png"; import j8 from "@/assets/images/map/j8.png";
import j9 from "@/assets/images/map/j9.png"; import j9 from "@/assets/images/map/j9.png";
import j10 from "@/assets/images/map/j10.png"; import j10 from "@/assets/images/map/j10.png";
import m1 from "@/assets/images/map/m1.png";
import m2 from "@/assets/images/map/m2.png";
import dwd from "@/assets/images/map/dwd.png"; import dwd from "@/assets/images/map/dwd.png";
import fwqbg1 from "@/assets/images/map/qlv.png"; import fwqbg1 from "@/assets/images/map/qlv.png";
import fwqbg2 from "@/assets/images/map/qlan.png"; import fwqbg2 from "@/assets/images/map/qlan.png";
@ -131,8 +131,8 @@ import b4 from "@/assets/images/map/b4.png";
import b5 from "@/assets/images/map/b5.png"; import b5 from "@/assets/images/map/b5.png";
import b6 from "@/assets/images/map/b6.png"; import b6 from "@/assets/images/map/b6.png";
import xcbg from "@/assets/images/map/xcbg.png"; import xcbg from "@/assets/images/map/xcbg.png";
import http from "@/utils/request.js";
import AED from "@/assets/images/map/AED.png"; import AED from "@/assets/images/map/AED.png";
//() //()
const jdm_arr = ref([]); const jdm_arr = ref([]);
const jdm_number_arr = ref([]); const jdm_number_arr = ref([]);
@ -212,6 +212,7 @@ const tsbq_id_total = ref([
]); ]);
// //
const csh = () => { const csh = () => {
// console.log(222, item.name);
xuanzhongCs.value = []; xuanzhongCs.value = [];
sfdd.value = false; sfdd.value = false;
title_choose.value = ""; title_choose.value = "";
@ -255,6 +256,7 @@ const csh = () => {
const chooseCsList = ref([]); const chooseCsList = ref([]);
const unChooseList = ref([]); const unChooseList = ref([]);
const sqname = ref(); const sqname = ref();
const townName = ref();
// //
const center_now = ref([]); const center_now = ref([]);
const center_center = ref([119.178783, 29.034583]); const center_center = ref([119.178783, 29.034583]);
@ -433,16 +435,43 @@ const markera = (e) => {
var marker = new BMapGL.Marker(new BMapGL.Point(e.latlng.lng, e.latlng.lat), { var marker = new BMapGL.Marker(new BMapGL.Point(e.latlng.lng, e.latlng.lat), {
icon: icons, icon: icons,
}); });
// //
map.addOverlay(marker); map.addOverlay(marker);
currentMarker = marker; currentMarker = marker;
}; };
const BMAP = () => { const BMAP = () => {
// //
map.addEventListener("click", markera); map.addEventListener("click", markera);
}; };
//
var circle;
const drawACircle = (v) => {
if (!circle) {
var point = new BMapGL.Point(119.184803, 28.853725);
circle = new BMapGL.Circle(point, 900, {
strokeColor: "yellow",
strokeWeight: 2,
strokeOpacity: 0.8,
fillOpacity: 0.1,
// fillColor: "yellow",
strokeStyle: "dashed",
zIndex: 99,
});
map.addOverlay(circle);
}
if (v === "hide") {
circle.hide();
} else {
circle.show();
map.addOverlay(circle);
map.setViewport({
center: new BMapGL.Point(119.184803, 28.853725),
zoom: 14,
});
}
};
const initMap = () => { const initMap = () => {
map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 20 }); map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 20 });
@ -499,8 +528,8 @@ const addPolygonCounty = () => {
map.addOverlay(polygon); map.addOverlay(polygon);
polygon.addEventListener("click", () => { polygon.addEventListener("click", () => {
// console.log(11111, item.name); townName.value = item.name;
console.log(11111, item.name, townName.value);
// if(item.name !== ""){ // if(item.name !== ""){
//   jrcs.value=false; //   jrcs.value=false;
//   console.log( jrcs.value,'000'); //   console.log( jrcs.value,'000');
@ -666,6 +695,7 @@ const addPolygonCountyCs = () => {
} }
}); });
title_choose.value = title_choose.value + `>${item.name}`; title_choose.value = title_choose.value + `>${item.name}`;
console.log(item.name);
cs_qk_arr.value.forEach((item, index) => { cs_qk_arr.value.forEach((item, index) => {
map.removeOverlay(cs_qk_arr.value[index]); map.removeOverlay(cs_qk_arr.value[index]);
}); });
@ -1166,12 +1196,16 @@ const DGcreateCs2 = (polygon, indexx) => {
}; };
// //
const addggfwq = () => { const addggfwq = () => {
// if (!fwqList || !fwqList.value) {
fwqList.value.map((item, index) => { fwqList.value.map((item, index) => {
createCustomOverlay(item, index); createCustomOverlay(item, index);
}); });
// return;
// }
}; };
// //
const createCustomOverlay = (polygon, indexx) => { const createCustomOverlay = (polygon, indexx) => {
drawACircle();
function createLabelDOM() { function createLabelDOM() {
var content = document.createElement("div"); var content = document.createElement("div");
content.style.display = "flex"; content.style.display = "flex";
@ -1321,27 +1355,33 @@ const changebq = (id) => {
} }
// choose.value.person = id; // choose.value.person = id;
}; };
//
const changeFwq = (id, list, center) => { const changeFwq = (id, list, center) => {
if (choose.value.fwq == id) { if (choose.value.fwq == id) {
// chooseArr.value = chooseArr.value.filter((item) => item !== "fwq"); // chooseArr.value = chooseArr.value.filter((item) => item !== "fwq");
choose.value.fwq = 9999; choose.value.fwq = 9999;
// removeAllPolygon("fwq"); console.log(11);
csh();
addPolygonCounty();
setTimeout(() => {
drawACircle("hide");
}, 500);
//
fwq_list_arr.value.forEach((item, index) => { fwq_list_arr.value.forEach((item, index) => {
map.removeOverlay(fwq_list_arr.value[index]); map.removeOverlay(fwq_list_arr.value[index]);
}); });
// xuanran();
} else { } else {
// chooseArr.value.push("fwq");
choose.value.fwq = id; choose.value.fwq = id;
fwqList.value = list; fwqList.value = list;
// removeAllPolygon("fwq"); //
addggfwq(); console.log(22);
// xuanran(); map.clearOverlays();
setTimeout(() => {
goMapCenter(center, 17);
}, 500);
// addggfwq() setTimeout(() => {
// drawACircle();
addggfwq();
goMapCenter(center, 16);
}, 500);
} }
// choose.value.fwq = id; // choose.value.fwq = id;
@ -1352,6 +1392,7 @@ const changeFwq = (id, list, center) => {
// createCustomOverlay(item); // createCustomOverlay(item);
// }); // });
}; };
const changeys = (id) => { const changeys = (id) => {
choose.value.yaosu = id; choose.value.yaosu = id;
}; };
@ -1515,7 +1556,6 @@ const tsbqTotal = ref([
]); ]);
// //
const jbfwqTotal = ref([ const jbfwqTotal = ref([
{ {
id: 0, id: 0,
@ -2388,6 +2428,25 @@ const reset_font = () => {
"scale(" + width / 1920 + "," + height / 1080 + ")"; "scale(" + width / 1920 + "," + height / 1080 + ")";
} }
}; };
// function initializeMap() {
// map = new BMapGL.Map("allmap");
// var point = new BMapGL.Point(119.175728, 28.846981);
// map.centerAndZoom(point, 16);
// map.enableScrollWheelZoom(true);
// // Initialize circle but don't add it to map yet
// circle = new BMapGL.Circle(point, 900, {
// strokeColor: "yellow",
// strokeWeight: 2,
// strokeOpacity: 0.8,
// fillOpacity: 0.1,
// fillColor: "yellow",
// strokeStyle: "dashed",
// zIndex: 99,
// });
// }
// window.onload = initializeMap;
onMounted(() => { onMounted(() => {
reset_font(); reset_font();
initMap(); initMap();
@ -2749,6 +2808,7 @@ onMounted(() => {
.title { .title {
.title_name { .title_name {
cursor: pointer;
display: flex; display: flex;
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
font-size: 34px; font-size: 34px;