postor / cesiumjs-heat

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

当设置min为0时,报“need max and min when not auto” #1

Closed duwensi closed 4 years ago

duwensi commented 4 years ago

问题根源:

// 以下为文件CesiumHeat.js第88行开始。
    if (!dataConfig.autoMaxMin) {
      if (!dataConfig.min || !dataConfig.max) {
        // !dataConfig.min这样的判定方式导致min为0时条件判断为true,从而报错。
        throw 'need max and min when not auto'
      }
      this.min = dataConfig.min
      this.max = dataConfig.max
    }
postor commented 4 years ago

首先cesium里0高度并不是地面,如果一定要你可以设置0.1之类的,负数也可以,我觉得0附近没有意义,也不打算0作为地面基准(遵守cesium系统),所以先关闭了