cesium 使用 heatmap.js 加载热力图

TypeError: Failed to execute 'geTypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. tComputedStyle' on 'Window': parameter 1 is not of type 'Element'. 

//方法是按照实例来的

 

 var heatMaps = CesiumHeatmap.create(

      this.viewer, // 视图层

      bounds, // 矩形坐标

      {

        // heatmap相应参数

        backgroundColor: "rgba(0,0,0,0)",

        radius: 50,

        maxOpacity: 0.5,

        minOpacity: 0,

        blur: 0.75,

      },

    );

 

    heatMaps.setWGS84Data(0, 100, getData(300));

    // this.viewer.zoomTo(this.viewer.entities);

 

    // 动态数据 [{x: -97.6433525165054, y: 45.61443064377248, value: 11.409122369106317}]

    function getData(length) {

      var data = [];

      for (var i = 0; i < length; i++) {

        var x = Math.random() * (-109 + 80) - 80;

        var y = Math.random() * (50 - 30) + 30;

        var value = Math.random() * 100;

        data.push({ x: x, y: y, value: value });

      }

      return data;

    }

 

 

 

 

报错 

 

'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. tComputedStyle' on 'Window': parameter 1 is not of type 'Element'. 

第一个参数类型错了。

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632