mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
added feature to add weights to the heatmap (#572)
This commit is contained in:
parent
0d3acb564e
commit
4faeeef56d
@ -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;
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user