当前位置:网站首页>Cesium 加载显示热力图
Cesium 加载显示热力图
2022-06-25 03:44:00 【王+V】
Cesium 加载显示热力图
我是一个小白,到目前为止对于3D方面的东西不是特别的懂,所以说,对于cesium使用的并不是特别的好,可以说根本不会吧,所以说也是在一点一点摸索,一点一点学习的过程中,所以说有些博文写的可能不是准确的,只是用来记录一下学习过程,错了别喷我啊!!
CesiumHeatmap
首先嘞,绘制热力图需要有一个工具,就是使用 CesiumHeatmap 这个工具,然后呢,下面是他的一个github的地址。

下载下来放到项目里面就可以了。
我把他放到了这里面嘞。

然后在项目里面引入一下。
<script src="./CesiumHeatmap/CesiumHeatmap.js"></script>
编写案例
// 测试热力图
function addHeatMap() {
let bounds = {
west: 106.243911,
east: 106.270811,
south: 29.244545,
north: 29.289995,
};
let heatMap = CesiumHeatmap.create(
viewer, // your cesium viewer
bounds, // bounds for heatmap layer
{
// heatmap.js options go here
// maxOpacity: 0.3
gradient: {
// the gradient used if not given in the heatmap options object
'.3': '#d9e7fc',
'.65': '#2a7aed',
'.8': '#fbd801',
'.95': '#18c3a1'
},
},
);
let data = [
{
x: 106.254153, y: 29.2883939, value: 76 },
{
x: 106.2654284, y: 29.2854935, value: 63 },
{
x: 106.265005, y: 29.284573, value: 1 },
{
x: 106.264001, y: 29.283456, value: 21 },
{
x: 106.263219, y: 29.282181, value: 28 },
{
x: 106.262788, y: 29.279673, value: 41 },
{
x: 106.2632087, y: 29.2742665, value: 75 },
{
x: 106.2505158, y: 29.28138, value: 76 },
{
x: 106.2531094, y: 29.2833591, value: 100 },
{
x: 106.2531093, y: 29.2844560, value: 80 },
{
x: 106.253293, y: 29.284826, value: 1 },
{
x: 106.250099, y: 29.285638, value: 21 },
{
x: 106.2469149, y: 29.2864109, value: 28 },
{
x: 106.254119, y: 29.276274, value: 41 },
];
let valueMin = 0;
let valueMax = 50;
heatMap.setWGS84Data(valueMin, valueMax, data);
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(106.254153, 29.2742665, 2e3),
orientation: {
heading: Cesium.Math.toRadians(0.0),
pitch: Cesium.Math.toRadians(-90.0),
roll: 0.0,
},
});
}
效果就是这个样子。

边栏推荐
- js工具函数,自己封装一个节流函数
- Two common OEE monitoring methods for equipment utilization
- Why can banana be a random number generator? Because it is the "king of radiation" in the fruit industry
- 2点睡10点起不算熬夜?除非你每天都能执行
- Do you really need automated testing?
- windows 2003 64位系统php运行报错:1% 不是有效的 win32 应用程序
- Solution to the problem that Linux crontab timed operation Oracle does not execute (crontab environment variable problem)
- The release function completed 02 "IVX low code sign in system production"
- Xidian AI ranked higher than Qingbei in terms of AI majors, and Nantah ranked the first in China in 2022 in terms of soft science majors
- Jilin University 22 spring March new development English comprehensive course (I) assignment assessment-00080
猜你喜欢

Musk: Twitter should learn from wechat and make 1billion people "live on it" into a super app

严重的PHP缺陷可导致QNAP NAS 设备遭RCE攻击

TC object structure and abbreviation

Xidian AI ranked higher than Qingbei in terms of AI majors, and Nantah ranked the first in China in 2022 in terms of soft science majors

AI writes its own code to let agents evolve! The big model of openai has the flavor of "human thought"

Sun Wu plays Warcraft? There is a picture and a truth

ICML 2022 | ByteDance AI Lab proposes a multimodal model: x-vlm, learning multi granularity alignment of vision and language

Apple's legendary design team disbanded after jobs refused to obey cook

JSP cannot be resolved to a type error reporting solution

X86 CPU, critical! The latest vulnerability has caused heated discussion. Hackers can remotely steal keys. Intel "all processors" are affected
随机推荐
Dr. Sun Jian was commemorated at the CVPR conference. The best student thesis was awarded to Tongji Ali. Lifeifei won the huangxutao Memorial Award
Jilin University 22 spring March "official document writing" assignment assessment-00029
OpenSUSE environment PHP connection Oracle
Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00005
Qt编译数据库插件通用步骤说明
Tensorflow, danger! Google itself is the one who abandoned it
How to quickly deliver high-value software
【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
程序猿职业发展9项必备软技能
【组队学习】SQL编程语言笔记——Task04
Winxp kernel driver debugging
X86 CPU, critical! The latest vulnerability has caused heated discussion. Hackers can remotely steal keys. Intel "all processors" are affected
【Harmony OS】【ArkUI】ets开发 图形与动画绘制
BSC parsing input data of transaction
OpenSUSE installation pit log
A new generation of cascadable Ethernet Remote i/o data acquisition module
[harmony OS] [arkui] ETS development graphics and animation drawing
Peking University has a new president! Gongqihuang, academician of the Chinese Academy of Sciences, took over and was admitted to the Physics Department of Peking University at the age of 15
2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
Work assessment of pharmaceutical polymer materials of Jilin University in March of the 22nd spring -00025