postor / cesiumjs-heat

heatmap for cesium | cesium的热力图
https://www.npmjs.com/package/cesiumjs-heat
MIT License
58 stars 14 forks source link

Failed to load image data:,: The source image could not be decoded #15

Open jimbo-zhang opened 4 months ago

CarMas1982 commented 2 months ago

Hi I'm facing the same issue when I'm trying to use my data:

export default {
    "source": "test",
    "feeds": [
        {            
            "gps_lat": 40.791890,            
            "gps_lon": 14.186457,            
            "s_d0": 40.0
        },
         {
            "gps_lat": 40.791614,
            "gps_lon": 14.186763,
            "s_d0": 50.0
        }
    ]
}

The index.js that I have implemented is:

const CesiumHeat = getCesiumHeat(Cesium);
const bbox = [14.186366951631296, 40.792273933154505, 14.187463, 40.790940];

let test = data.feeds.map(({ gps_lon, gps_lat, s_d0 }) => {
  return {
    x: gps_lon,
    y: gps_lat,
    value: s_d0,
  }
});

viewer.camera.flyTo({
  destination: Cesium.Rectangle.fromDegrees(...bbox),
  duration: 0.1,
  complete:()=>{
    const heat = new CesiumHeat(
      viewer,
      test,
      bbox
    )
  }
})

I'm using the 1.0.7 version.

postor commented 1 month ago

@jimbo-zhang @CarMas1982 cesium版本多少? 旧版本的cesium试试旧版本的插件1.0.2