google-map icon indicating copy to clipboard operation
google-map copied to clipboard

Map becomes grey when refreshing page

Open joaoDigitina opened this issue 9 years ago • 1 comments

This issue is hard to replicate but when i refresh the page, some times not all, the map either disapeers or becomes grey .

I am forcing resize on google-map-ready using a listener on that event like so :

listeners: { "google-map-ready": "_resizeMap" }

private _resizeMap(e: Event) { (e.target).resize(); }

But that still doesn't fix the issue which happens in a intermittent way .

joaoDigitina avatar Jan 24 '17 14:01 joaoDigitina

Something similar happens to me.

I could fix the grey problem with a resize. I think it becomes grey when you change the visibility of the map, so you need to do a resize.

My problem is that the map sometimes doesn't get rendered, it appears all white. The resize doesn't fix that.

I think the problem is that the #map div gets a position relative so it doesn't fit to the container. If you change it and resize, it works. I am lazy loading the map and using a layout with iron-pages.

screen shot 2017-02-23 at 12 20 40

I fixed it with this code, it forces the position absolute and resize the map when the visibility of the container changes and when the map is lazy loaded. Maybe an ugly workaround.

screen shot 2017-02-23 at 12 32 45

pdgago avatar Feb 23 '17 11:02 pdgago