mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
17 lines
466 B
JavaScript
17 lines
466 B
JavaScript
export const generateHeatmap = (instance, { positions }) =>
|
|
new instance.visualization.HeatmapLayer({
|
|
data: positions.reduce(
|
|
(acc, { lat, lng, weight = 1 }) => {
|
|
acc.push({
|
|
location: new instance.LatLng(lat, lng),
|
|
weight,
|
|
});
|
|
return acc;
|
|
},
|
|
[]
|
|
),
|
|
});
|
|
|
|
export const optionsHeatmap = (instance, { options = {} }) =>
|
|
Object.keys(options).map(option => instance.set(option, options[option]));
|