I was looking for some solution. I had the same problems, and I'm not the only one. The line of code above is not enough, but I noticed that manually resizing my browser fixes the problem. If he solves yours, then this is how I solve mine:
1) Add this at the end of your function to initialize your map. It will add a listener to it and call the function when loading the map. It will mainly simulate resizing.
google.maps.event.addListenerOnce(map, 'idle', function(){ $(window).resize(); map.setCenter(yourCoordinates); });
I had to re-place the card after resizing
2) Create a resize listener, raising the google map resize event as follows:
$(window).resize(function() { if ($("#map_canvas").children().length > 0){ if (map) google.maps.event.trigger(map, 'resize'); }});
I also had to put the card outside of my initialization function ... I know this is not the best solution, but now it works. Do not worry about calling resize ().
This seems to be due to a hidden div containing a google map. I also found a similar solution on this jfyi website . Good luck
Bruno source share