Open bschoenfeld opened 6 years ago
setTimeout(func, 250)
lgtm
Is async defer
appropriate?
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=BLRRRRRRGGGHHH&callback=initialize" async defer>
And did you try waiting inside $( document ).ready()
I'd be surprised if it's a problem with the document being ready, scripts loaded in, etc because we don't try to show the map on page load. You can wait as long as you'd like before clicking the button to show the map and you'll still experience the problem.
What happens when you click the button to see the map is we generate a view with a google map in it, shove it into a div tag and invoke the resize command. So it feels like a timing thing where the view isn't actually rendered quite right when the resize is invoked, causing google maps to think it doesn't need to render the tiles.
But I can't really figure it out... and it was all working for a while and then it broke without us changing anything, so I guess maybe something changed in the google maps js?
Google Maps JS change sounds like the likely culprit.
Map tiles aren't loading the first time you open the map view on any stop on the home page. Through playing around in the console, I discovered that showing the mapcanvas at different times, or even just pausing execution with a break point seems to fix the problem. I suppose it's an issue with timing of the DOM rendering. This isn't an elegant solution, but it seems to fix the issue. Open to better ideas.