MCPcopy Index your code
hub / github.com/google-map-react/google-map-react / generateHeatmap

Function generateHeatmap

src/google_heatmap.js:1–10  ·  view source on GitHub ↗
(instance, { positions })

Source from the content-addressed store, hash-verified

1export const generateHeatmap = (instance, { positions }) =>
2 new instance.visualization.HeatmapLayer({
3 data: positions.reduce((acc, { lat, lng, weight = 1 }) => {
4 acc.push({
5 location: new instance.LatLng(lat, lng),
6 weight,
7 });
8 return acc;
9 }, []),
10 });
11
12export const optionsHeatmap = (instance, { options = {} }) =>
13 Object.keys(options).map((option) => instance.set(option, options[option]));

Callers 1

GoogleMapClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected