question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

subsequent render breaks google map

See original GitHub issue

So at first I thought it was an issue with on-load, but I realized that Google Maps supports using an element not yet in the DOM…

Ok, so I have an example here where subsequent rerenders break the map: https://github.com/knownasilya/pizza-locator/blob/gh-pages/components/google-map.js#L13

To reproduce:

  1. visit https://knownasilya.github.io/pizza-locator/
  2. click “closest locations”

Map disappears on second render…

Looks like the element doesn’t get updated properly the second time. Any thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
knownasilyacommented, Jun 29, 2016

Ok, I fixed it with your suggestion. See my latest commit.

0reactions
toddselfcommented, Jun 29, 2016

Awesome!

Yeah, the google maps API is a bit odd sometimes, but this is great 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Map rendering is broken in Safari on laptop - Google Support
Suddenly maps won't render. The map shows correctly when initially loading, but then switches to a broken display.
Read more >
reactjs - re-render GoogleMapReact - Stack Overflow
Hi I am creating nextjs Application in which I have used GoogleMapReact from google-map-react library,I want to re-render my GoogleMapReact ...
Read more >
google-map-react now load google maps api all the time even ...
I use this lib, but I manually load the google maps api. now i just found out that the lib is loaded multiple...
Read more >
Immersive view coming soon to Maps — plus more updates
Take a look at the latest updates to Maps, including a more intuitive, immersive way to explore the world.
Read more >
Building an interactive map with Google Maps ... - YouTube
Looking for a crash course on how to build amazing, interactive maps with React and Google Maps Platform? In this video, Leigh Halliday ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found