Google Maps random vertical line in Chrome

前端 未结 5 1594
Happy的楠姐
Happy的楠姐 2020-12-17 10:58

I am implementing google maps on my website and I just started noticing this line appearing. It only happens in Chrome (Windows) and no matter how far I step back in my code

5条回答
  •  一生所求
    2020-12-17 11:22

    Same issue here. I've come to the conclusion it is a Chrome bug. It's only shown up in the past week or so. It only occurs if you have a map centred. Here's how to reproduce the issue.

    
    
        
            
            
            
            
        
        
            

    You should see a centred map. If you resize your browser slowly the horizontal lines come and go. If you remove the margin:0 auto from #map-canvas the map aligns left and the lines are gone.

    Alternatively, add max-width: 100% to #map-canvas and you'll have a full width map and no lines. So, it's only centred maps which affects a lot of responsive sites.

提交回复
热议问题