-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HeatmapLayer and withScriptjs are sort-of incompatable #409
Comments
Hey ZephD. I take it then you managed to sucesfully get the react-google-maps to display heatmap data? Would you mind sharing the source code |
@matthill1 : I had to manually tweak the react-google-maps code. See #376. This, plus the code above to translate the LatLng objects to google's LatLng objects if google exists. |
I managed to get it to display in the following way:
where heatmapdata is set within const GoogleMapHeatMaps |
Please refer to Getting Help section in the README (or #469). |
HeatmapLayer requires a google.maps.LatLng object and cannot accept a LatLngLiteral ({lat:0, lng:0}).
However, google.maps.LatLng is loaded asynchronously with withScriptjs, and therefore is not available when creating the props.
My current workaround is to convert the data upon render if window.google exists.
It may be beneficial to do this within HeatmapLayer, allowing us to use LatLngLiterals.
Also, we can do it upon data set, rather than upon render, reducing how often you loop through the data.
The text was updated successfully, but these errors were encountered: