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

CesiumJS 案例 P27:创建椭圆、创建带边框的椭圆、创建圆、创建带边框的圆、创建椭圆环、创建圆环

CesiumJS

  • CesiumJS 是一个开源的 JavaScript 库,它用于在网页中创建和控制 3D 地球仪(地图)
  1. CesiumJS 官网:https://www.cesium.com/

  2. CesiumJS 下载地址:https://www.cesium.com/platform/cesiumjs/

  3. CesiumJS API 文档:https://cesium.com/learn/cesiumjs/ref-doc/index.html


一、创建椭圆

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建椭圆</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 50000, // 长轴(米)semiMinorAxis: 25000, // 短轴(米)material: Cesium.Color.BLUE.withAlpha(0.5), // 颜色},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

二、创建带边框的椭圆

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建带边框的椭圆</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 5000, // 长轴(米)semiMinorAxis: 2500, // 短轴(米)material: Cesium.Color.BLUE.withAlpha(0.5), // 颜色height: 0,outline: true,outlineColor: Cesium.Color.RED,outlineWidth: 10,},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

三、创建圆

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建圆</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 2500, // 长轴(米)semiMinorAxis: 2500, // 短轴(米)material: Cesium.Color.BLUE.withAlpha(0.5), // 颜色},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

四、创建带边框的圆

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建带边框的圆</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 2500, // 长轴(米)semiMinorAxis: 2500, // 短轴(米)material: Cesium.Color.BLUE.withAlpha(0.5), // 颜色height: 0,outline: true,outlineColor: Cesium.Color.RED,outlineWidth: 10,},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

五、创建椭圆环

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建椭圆环</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 5000, // 长轴(米)semiMinorAxis: 2500, // 短轴(米)material: new Cesium.Color(0, 0, 0, 0), // 颜色height: 0,outline: true,outlineColor: Cesium.Color.RED,outlineWidth: 10,},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

六、创建圆环

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Entity ellipse - 创建圆环</title><link rel="stylesheet" href="../js/Cesium-1.112/Build/Cesium/Widgets/widgets.css" /><style>* {margin: 0;padding: 0;box-sizing: border-box;}html,body {width: 100%;height: 100%;}.container {width: 100%;height: 100%;}</style></head><body><div id="container"></div></body><script src="../js/Cesium-1.112/Build/Cesium/Cesium.js"></script><script>const viewer = new Cesium.Viewer("container");const entity = viewer.entities.add({position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),ellipse: {semiMajorAxis: 2500, // 长轴(米)semiMinorAxis: 2500, // 短轴(米)material: new Cesium.Color(0, 0, 0, 0), // 颜色height: 0,outline: true,outlineColor: Cesium.Color.RED,outlineWidth: 10,},});// 设置相机当前正在跟踪的实体实例viewer.trackedEntity = entity;</script>
</html>

http://www.mrgr.cn/news/72342.html

相关文章:

  • 数据分析丨世界杯冠军猜想:EA 体育游戏模拟能成功预测吗?
  • LaTeX之四:如何兼容中文(上手中文简历和中文论文)、在win/mac上安装新字体。
  • 小面馆叫号取餐流程 佳易王面馆米线店点餐叫号管理系统操作教程
  • 【深度学习】使用硬件加速模型训练速度
  • Apache ECharts
  • 【Linux】内核模版加载modprobe | lsmod
  • WPF 中的视觉层和逻辑层有什么区别?
  • frp搭建内网穿透
  • PMC部门如何精准把控生产计划和生产进度?关键要点全解析
  • 【miniMax开放平台-注册安全分析报告-无验证方式导致安全隐患】
  • day31-二叉树的最大深度
  • Git服务部署教程
  • Linux中扫描网络的“nmap”工具使用方法
  • Conda安装软件错误(Pycharm)
  • 【更新中】《硬件架构的艺术》笔记(二):时钟与复位
  • 使用Flask部署自己的pytorch模型(猫品种分类模型)
  • 举例说明自然语言处理(NLP)技术。
  • 丹摩征文活动|CogVideoX-2b:从0到1,轻松完成安装与部署!
  • 功能性材料立式粉碎机、立式破碎机、立式超细磨、立式磨粉机
  • vxe-table 实现全部单元格都能编辑的方法
  • GPS L1信号捕获跟踪MATLAB仿真(终极版)
  • ubuntu20.04_从零LOD-3DGS的复现
  • 服务器数据恢复——Ext4文件系统使用fsck后mount不上的数据恢复案例
  • netmap.js:基于浏览器的网络发现工具
  • PET-文件包含-FINISHED
  • ManageOne_SC里业务员账号user01发布ECS