Google Map Support #2398
Answered
by
CAYdenberg
simongroom
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
CAYdenberg
Apr 8, 2024
Replies: 1 comment 7 replies
-
I wouldn't even try serverside rendering. If you have a "default" map just take a screenshot of that and send the image as the "no javascript" version of things. On the needed route, load the google map javascript with a regular ol' script tag. Then in your island, in a useEffect hook instantiate the actual map according to the google maps docs. Don't use react if you don't need to, and don't use google-map-react as it's probably just it's probably just adding a lot of unnecessary complexity. |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
simongroom
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wouldn't even try serverside rendering. If you have a "default" map just take a screenshot of that and send the image as the "no javascript" version of things.
On the needed route, load the google map javascript with a regular ol' script tag. Then in your island, in a useEffect hook instantiate the actual map according to the google maps docs. Don't use react if you don't need to, and don't use google-map-react as it's probably just it's probably just adding a lot of unnecessary complexity.