This is the heatmap library on top of deck .gl. It decides color based on max value of nearest points.
Using npm.
npm install ee-max-value-heatmap
import MaxValueHeatmap from 'ee-max-value-heatmap';
import { Deck } from '@deck.gl/core';
let deck = new Deck({
canvas: 'deck-canvas',
width: '100%',
height: '100%',
initialViewState: INITIAL_VIEW_STATE,
controller: true
});
const HEATMAP_LAYER = new MaxValueHeatmap({
id: 'heatmap',
data,
opacity: 0.9,
getPosition: d => d.geometry.coordinates,
getWeight: d => d.properties.value
});
deck.setProps({
layers: [HEATMAP_LAYER]
});