This commit is contained in:
姚宇浩 2024-08-02 14:40:45 +08:00
commit a15d1cbeb9
1 changed files with 52 additions and 10 deletions

View File

@ -1161,7 +1161,7 @@ const getData = async (i, e) => {
"100nlPercent",
];
if (res.data.ageGroupsPercent) {
console.log(PopulationRatio.value[0].progress);
// console.log(PopulationRatio.value[0].progress);
agename.forEach((key, index) => {
if (PopulationRatio.value[index]) {
PopulationRatio.value[index].progress =
@ -1309,7 +1309,6 @@ const getDatas = async (e, i) => {
"100nlPercent",
];
if (res.data.ageGroupsPercent) {
console.log(PopulationRatio.value[0].progress);
agename.forEach((key, index) => {
if (PopulationRatio.value[index]) {
PopulationRatio.value[index].progress =
@ -1391,7 +1390,6 @@ const getDatas2 = async (e, i, cs) => {
"100nlPercent",
];
if (res.data.ageGroupsPercent) {
console.log(PopulationRatio.value[0].progress);
agename.forEach((key, index) => {
if (PopulationRatio.value[index]) {
PopulationRatio.value[index].progress =
@ -1742,7 +1740,6 @@ const to_jd = (item_name) => {
//
const open_detail = () => {
dialogShow.value = true;
console.log(1111111111, dialogShow.value);
};
const close = () => {
dialogShow.value = false;
@ -1826,19 +1823,65 @@ const addggfwq = () => {
const average = sum / numericCoordinates.length; //
return parseFloat(average.toFixed(5)); // 5
}
data.fwqCoordinates1 = calculateAverage(data.fwqCoordinates1);
data.fwqCoordinates2 = calculateAverage(data.fwqCoordinates2);
drawACircle();
let distances = []; //
fwqList.value.forEach((item) => {
let distance = algorithm(
(item.point[0] = Number(item.point[0].replace(/[^0-9.-]/g, ""))),
(item.point[1] = Number(item.point[1].replace(/[^0-9.-]/g, ""))),
data.fwqCoordinates1,
data.fwqCoordinates2
);
distances.push(distance); //
});
let maxDistance = Math.max(...distances); //
maxDistance = Math.ceil(maxDistance * 1.8); //
if (maxDistance < 100) {
maxDistance = 150; // 100 150
}
console.log("最大距离:", maxDistance);
drawACircle(maxDistance);
} else {
ElMessage.warning("无数据");
}
};
//线
const algorithm = (point1, point2, point3, point4) => {
// console.log(point1, point2, point3, point4, 5555);
let [x1, y1] = [point1, point2];
let [x2, y2] = [point3, point4];
let Lat1 = rad(x1); //
let Lat2 = rad(x2);
let a = Lat1 - Lat2; //
let b = rad(y1) - rad(y2); //
let s =
2 *
Math.asin(
Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(Lat1) * Math.cos(Lat2) * Math.pow(Math.sin(b / 2), 2)
)
);
//
s = s * 6378137.0; //
s = Math.round(s * 10000) / 10000; //
return s;
};
//
const rad = (d) => {
return (d * Math.PI) / 180.0;
};
//
const drawACircle = (v) => {
const drawACircle = (maxDistance) => {
// console.log("1", data.fwqCoordinates1, data.fwqCoordinates2);
if (!circle) {
var point = new BMapGL.Point(data.fwqCoordinates1, data.fwqCoordinates2);
circle = new BMapGL.Circle(point, 1000, {
circle = new BMapGL.Circle(point, maxDistance, {
strokeColor: "yellow",
strokeWeight: 2,
strokeOpacity: 0.8,
@ -2184,7 +2227,6 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
}
let num = "";
if (choose.value.person == "6666") {
console.log(1);
num = "swrs";
} else if (
choose.value.person == "cjr" ||
@ -2248,7 +2290,7 @@ const loadCs = (name) => {
};
//
const addPolygonCountyCs = () => {
console.log(11111111111111, xkzDk);
// console.log(11111111111111, xkzDk);
xkzDk.map((item, index) => {
let num = index % 9;
let fillColor = colorList[num].bg;