react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

Heatmap Layer not displaying in Google Maps API (@react-google-maps/api)

Open richardsondx opened this issue 2 years ago • 5 comments

Issue template

Please provide an explanation of the issue

The instruction provided in the docs for Heatmap layers are not working. When I follow the instruction the heatmap layer doesn't appear.

https://react-google-maps-api-docs.netlify.app/#!/HeatmapLayer/1

Related Stackoverflow issue: https://stackoverflow.com/questions/72219002/heatmap-layer-not-displaying-in-google-maps-api-react-google-maps-api

Your Environment

os: mac

node --version v16.13.1

react version

webpack version

@babel version

@react-google-maps/api version

"^9.4.5"

How does it behave?

The map appears with no errors and there are not heatmap layers. None of the point provided are showing.

How should it behave correctly?

The heatmaps points should appear on the map and the heatmap layer should appear.

Basic implementation of incorrect behavior in codesandbox.com

richardsondx avatar Sep 21 '22 18:09 richardsondx

Also experiencing this when trying to implement Heatmaps, or even Markers or any other children of the GoogleMap component.

diskomo avatar Nov 08 '22 12:11 diskomo

Also experiencing this, but only for Heatmaps.

alexandre1921 avatar Nov 10 '22 13:11 alexandre1921

@alexandre1921 It's due to it being a class component, apparently. Some of the components have been converted to functional and some have not. I have a PR here adding the HeatmapLayerF component and my project now works with heatmaps :)

diskomo avatar Nov 10 '22 13:11 diskomo

closing an issue due to HeatmapLayerF implemented.

JustFly1984 avatar Nov 15 '22 06:11 JustFly1984

Fix proposed by @diskomo worked well! Thanks 👍🏽

olafkotur avatar Dec 27 '22 14:12 olafkotur