使用网格热力图展示点数据,并通过热力颜色展示数据权重,半径单位:米。
以下为示例代码:
const map = new AMap.Map('container');
const layer = new Loca.GridLayer({
map: map
});
layer.setData(heatdata, {
lnglat: 'lnglat'
});
layer.setOptions({
style: {
// 网格热力半径,单位:米
radius: 300,
opacity: [0.1, 0.8],
// 热力聚合模式,count 为点数量加和
mode: 'count', // 聚合模式,可选值: sum(值求和)、max(最大值)、min(最小值)、mean(平均值)、median(中位数)、count(个数)
// 颜色范围
color: [
'#f0f9e8',
'#bae4bc',
'#7bccc4',
'#43a2ca',
'#0868ac',
],
text: {
content: '文字', // 文字内容
direction: 'center', // 文字方位
offset: [10, -10], // 偏移大小
fo