Commit fc7ab78e authored by xinzhedeai's avatar xinzhedeai

add: 人员数量-》10

parent 42ce23dc
......@@ -139,31 +139,33 @@ export default {
y: 4293961.185794622,
z: 3863430.5618300107,
});
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height + 10;
// height
// :
// 75909.13761736471
// latitude
// :
// 37.19751259330305
// longitude
// :
// 122.16058393814254
console.log("人员经纬度:", {
longitude: longitude,
latitude: latitude,
height: height,
const baseLongitude = Cesium.Math.toDegrees(cartographic.longitude);
const baseLatitude = Cesium.Math.toDegrees(cartographic.latitude);
const baseHeight = cartographic.height + 1;
console.log("人员经纬度基准点:", {
longitude: baseLongitude,
latitude: baseLatitude,
height: baseHeight,
});
// 清除现有的人员列表
this.personnelList = [];
for (let index = 0; index < 1; index++) {
// 生成10个不同的经纬度坐标,确保它们之间的距离不超过100米
// 在经纬度上,约0.00001度的变化大约对应1米(赤道附近)
// 为了确保不超过100米,我们使用±0.00005度的随机偏移
const maxOffset = 0.00005;
for (let index = 0; index < 10; index++) {
// 生成随机偏移量,确保每个点都不同但距离不远
const lngOffset = (Math.random() - 0.5) * 2 * maxOffset;
const latOffset = (Math.random() - 0.5) * 2 * maxOffset;
this.personnelList.push({
lng: longitude,
lat: latitude,
height: height + 10 * index,
lng: baseLongitude + lngOffset,
lat: baseLatitude + latOffset,
height: baseHeight, // 高度略有不同,便于区分
perName: "张三" + index,
status: "online", // 在线
avatar: "/static/images/avatars/zhangsan.png", // 头像
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment