JustFly1984 / react-google-maps-api

React Google Maps API
MIT License
1.76k stars 426 forks source link

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

Open richardsondx opened 1 year ago

richardsondx commented 1 year ago

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

diskomo commented 1 year ago

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

alexandre1921 commented 1 year ago

Also experiencing this, but only for Heatmaps.

diskomo commented 1 year ago

@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 :)

JustFly1984 commented 1 year ago

closing an issue due to HeatmapLayerF implemented.

olafkotur commented 1 year ago

Fix proposed by @diskomo worked well! Thanks 👍🏽