HeatPointLayer

MapVGL 已不再开发新功能。新项目建议使用 JSAPI 4.0,可以用 BMap.WebGLCustomLayer 实现类似效果,查看示例

MapVGL is no longer adding new features. For new projects, we recommend JSAPI 4.0, where you can use BMap.WebGLCustomLayer to achieve a similar effect. View example

用来展示热力点图效果,继承自PointLayer

示例

动手试试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var layer = new mapvgl.HeatPointLayer({
gradient: {
0.0: 'rgb(50, 50, 256)',
0.1: 'rgb(50, 250, 56)',
0.5: 'rgb(250, 250, 56)',
1.0: 'rgb(250, 50, 56)'
},
data: [{
geometry: {
type: 'Point',
coordinates: [116.392394, 39.910683]
},
properties: {
count: 2
}
}]
});

options属性

style

解释:展示方式

类型:string

默认值:’grid’

可选值:

  • grid,默认值,按半径聚合展示
  • normal,按真实坐标展示

girdSize

解释:聚合半径,当style属性为grid时有效

类型:Number

默认值:500

gradient

解释:渐变色

类型:Object

默认值:

1
2
3
4
5
6
{
0.0: 'rgb(50, 50, 256)',
0.1: 'rgb(50, 250, 56)',
0.5: 'rgb(250, 250, 56)',
1.0: 'rgb(250, 50, 56)'
}

max

解释:最大阈值

类型:Number

min

解释:最小阈值

类型:Number

data内容

数据格式内容:

1
2
3
4
5
6
7
8
9
[{
geometry: {
type: 'Point',
coordinates: [116.392394, 39.910683]
},
properties: {
count: 2
}
}]