当前位置: 首页 > news >正文

cesium 根据经纬度高度进行额度补偿

const offsetvalue = 90; /** *度数补偿值 */ const setCameraPosition = async (lat: number, lon: number, du: number) => { var point = turf.point([lat, lon]); var distance = 600 * 1.732; var bearing = du - 180 + offsetvalue; var options: any = { units: "kilometers" }; var destination = turf.destination(point, distance / 1000, bearing, options); console.log("destination:", destination.geometry.coordinates); let latnew = 0; let lonnew = 0; var fsd = 105; var shiyejili = 250; let duoffsetvalue = du + offsetvalue; latnew = destination.geometry.coordinates[0]; lonnew = destination.geometry.coordinates[1]; console.log("duoffsetvalue:",duoffsetvalue,"latnew, lonnew:",latnew, lonnew) viewer.scene.camera.setView({ destination: Cesium.Cartesian3.fromDegrees(latnew, lonnew, 1000), // 经度,纬度,高度 orientation: { heading: Cesium.Math.toRadians(duoffsetvalue), // 方向 pitch: Cesium.Math.toRadians(-45), // 俯仰角 roll: 0.0, // 翻滚角 }, }); console.log("视角:", lat); };

offsetvalue、distance

var destination = turf.destination(point, distance / 1000, bearing, options);内的数据根据实际需求进行更改

const offsetvalue = 90;
/**
*度数补偿值
*/
const setCameraPosition = async (lat: number, lon: number, du: number) => {
var point = turf.point([lat, lon]);
var distance = 600 * 1.732;
var bearing = du - 180 + offsetvalue;
var options: any = { units: "kilometers" };
var destination = turf.destination(point, distance / 1000, bearing, options);
console.log("destination:", destination.geometry.coordinates);

let latnew = 0;
let lonnew = 0;
var fsd = 105;
var shiyejili = 250;
let duoffsetvalue = du + offsetvalue;
latnew = destination.geometry.coordinates[0];
lonnew = destination.geometry.coordinates[1];

console.log("duoffsetvalue:",duoffsetvalue,"latnew, lonnew:",latnew, lonnew)
viewer.scene.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(latnew, lonnew, 1000), // 经度,纬度,高度
orientation: {
heading: Cesium.Math.toRadians(duoffsetvalue), // 方向
pitch: Cesium.Math.toRadians(-45), // 俯仰角
roll: 0.0, // 翻滚角
},
});
console.log("视角:", lat);
};

http://www.jsqmd.com/news/140024/

相关文章:

  • 从概念到实践,带你彻底搞懂AI智能体
  • 数据交易中的数据基础设施与云服务
  • 滚珠丝杆直线导轨厂家哪家适配自动化设备高精度传动需求?
  • 2025/12/21
  • ControlNet核心实现:从0到1构建可控AI绘画系统
  • 《jQuery UI API 文档》
  • 国内滚珠丝杆直线导轨厂家中,哪些有专业售前售后技术支持?
  • 软件工程学习日志2025.12.25
  • KAIST AI团队革命性突破:无需深度估计也能让视频自由变换视角
  • C语言——迷宫问题
  • 【光的偏振与光功率 / 能量测量学习笔记】
  • Spring AI Alibaba — ChatModel与ChatClient的联系与区别
  • 工程仿真、CFD 分析软件 Tecplot 2025 R1 超详细下载安装教程全流程指南:从下载到使用,新手也能看懂
  • 小小的SSL证书如何为您的业务带来大生意
  • 2025/12/22
  • LoPA:上海交大与华为联手破解AI推理新困境
  • 完整理解乐观锁(以预定系统为例)
  • 大模型流式输出Streaming Output
  • python学习笔记
  • C156D飞腾加固计算机在国产化计算体系中的应用定位
  • 手写数字识别(3种算法对比)
  • CRMEB WxJava,微信生态开发外挂来袭!
  • Perfecxion.ai发布:生产级安全编程数据集防范AI代码漏洞
  • 夸克网盘下载不限速_在线解析站
  • 别再把 K8s 当大号 Docker 了:我用 Kubernetes 跑数据任务踩过的那些坑
  • 前端架构演进之路——从网页到应用
  • 利用SAT求解优化量子电路映射
  • P3241 [HNOI2015] 开店
  • Shell 脚本
  • 不懂技术怕什么?陀螺匠低代码平台,拖拽之间搞定复杂数据关联