mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
* Rewrite library using create-react-library * Export utils properly * Remove unnecessary code and fix eslintignore * Update CHANGELOG
14 lines
438 B
JavaScript
14 lines
438 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]));
|