From 4faeeef56d61cfcec6ea2dc6966a4fd29d079175 Mon Sep 17 00:00:00 2001 From: Donovan De Smedt Date: Wed, 9 May 2018 00:09:13 +0200 Subject: [PATCH] added feature to add weights to the heatmap (#572) --- src/google_heatmap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/google_heatmap.js b/src/google_heatmap.js index e40d0cb..9805e07 100644 --- a/src/google_heatmap.js +++ b/src/google_heatmap.js @@ -1,9 +1,10 @@ export const generateHeatmap = (instance, { positions }) => new instance.visualization.HeatmapLayer({ data: positions.reduce( - (acc, { lat, lng }) => { + (acc, { lat, lng, weight = 1 }) => { acc.push({ location: new instance.LatLng(lat, lng), + weight, }); return acc; },