我正在创建带有时间轴的热图,并在用户拖动滑块时使用新的聚类点更新geojson源。
我要求热图权重能够响应point_count:
'heatmap-weight': ['get', 'point_count']
然后将其应用于热图颜色:
'heatmap-color': [
'interpolate',
['linear'],
['heatmap-density'],
0, 'rgba(255,0,0,0)',
1, 'rgba(255,0,0,0.9)'
],
但是,我需要在整个时间轴上设置最小和最大point_count值,我认为可以这样实现:
'heatmap-weight': [
'interpolate',
['linear'],
['get', 'point_count'],
20, 0,
250, 1
]
但这似乎不起作用,有人知道如何为point_count设置范围吗?