Skip to content
On this page

gridHeatmap

GridHeatMap

Kind: global class
Version: 1.0.0

new GridHeatMap(opts)

生成网格热力图

Returns: Group - 根据参数返回网格热力图

ParamTypeDescription
optsobject参数
opts.dataArray需要绘制的数据
opts.spacenumber分段数

Example

js
ftthree.GridHeatMap({
  data: [
    {
      geometry: {
        coordinates: [112, 23]
      },
      properties: {
        value: 'value'
      }
    }
  ],
  gradient: {
    '.1': '#00008B',
    '.25': '#00FF00',
    '.5': '#00FF00',
    '.55': '#FFFF33',
    // '.75': '#FF6600',
    '.8': '#FF3333'
  },
  space: 10
});

GridHeatMap.updateGrid(grid, data, gradient, isAnimation, animationTime, callback)

更新网格。如果需要动态变化,需要调用 TWEEN 库

Kind: static method of GridHeatMap

ParamTypeDescription
gridGroup需要更新的网格
dataArray用来更新网格的数据,需要与创建时的数据除了数值 value 之外其他相同
gradientobject颜色分层对象,默认使用内置的分层
isAnimationboolean是否动态变化,默认为否
animationTimenumber动态变化时间 默认为 1000 毫秒
callbackfunction回调函数,完成修改后调用