Cesium淹没分析(带热力图效果)

Cesium淹没分析(带热力图效果)

效果图

在这里插入图片描述

1.构建的rectangle Entity,实现淹没效果


let entity = viewer.entities.add({
            rectangle: {
                coordinates: Cesium.Rectangle.fromCartesianArray(Cesium.Cartesian3.fromDegreesArray(coordinates)),//coordinates是水淹范围经纬度坐标数组 格式[经度,纬度,经度,纬度,......]
                material: new Cesium.ImageMaterialProperty({
                    image: heatMap._renderer.canvas,//热力图画布
                    transparent: true
                }),

                extrudedHeight: new Cesium.CallbackProperty(() => extrudedHeight, false)//extrudedHeight水淹高度
            }
        })

2.加入热力图画布

在这里插入图片描述

//热力图数值 部分例子
 [{
        "x": 0,
        "y": 100,
        "value": 176.95826437216726
    },
    {
        "x": 0,
        "y": 98,
        "value": 230.1923940189951
    },
    {
        "x": 0,
        "y": 96,
        "value": 426.53616538853737
    },
    {
        "x": 0,
        "y": 94,
        "value": 497.42594307709976
    },
    {
        "x": 0,
        "y": 92,
        "value": 408.30661293631476
    },
    {
        "x": 0,
        "y": 90,
        "value": 181.39132069060315
    },
    {
        "x": 0,
        "y": 88,
        "value": 176
    },
    {
        "x": 0,
        "y": 86,
        "value": 176
    },
    {
        "x": 0,
        "y": 84,
        "value": 176
    }]
 //热力图构建
        var heatDoc = document.createElement("div");
        heatDoc.setAttribute("style", "width:100px;height:100px;margin: 0px;display: none;");
        document.body.appendChild(heatDoc);
        // 创建热力图对象
        var heatmap = h337.create({
            container: heatDoc,
            radius: 2,//渲染半径
            maxOpacity: .9,//色块最大透明度
            minOpacity: .7,//色块最小透明度
            blur: .55,
            gradient: {
                '0.9': 'red',
                '0.7': 'orange',
                '0.5': 'yellow',
                '0.3': 'blue',
            },//色阶
        });
        // 添加数据
        heatmap.setData({
            max: max,
            data: data
        });

        return heatmap;

heatmap.js、CesiumHeatmap.js
地址:https://download.csdn.net/download/weixin_44339199/84194949
完整代码:https://download.csdn.net/download/weixin_44339199/84656234

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

imyang_123

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值