added feature to add weights to the heatmap (#572)

This commit is contained in:
Donovan De Smedt 2018-05-09 00:09:13 +02:00 committed by Michael Diego
parent 0d3acb564e
commit 4faeeef56d

View File

@ -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;
},