If you need to render a Google map in a hidden div , and run into grey areas on the map when you eventually show it, try this:
Instead of calling the GMap2 constructor like this:
var map = new GMap2(document.getElementById("map_canvas"));Add the height and width into the GMap2 call like this:
var map = new GMap2(document.getElementById("map_canvas"),{size: new GSize(800,600)});Why?
Normally, when a Google map is rendered in a visible element, it auto-detects the div's size it is contained within. When the map is initialized in a hidden div, it seems that this auto-detection of size doesn't succeed, and when the map is finally shown you will see grey areas where the map's initialization didn't anticipate filling. So, if you pass the GMap2 constructor a GSize, it will know from the start, visible or not, what size it should be.