Google map v3 hidden tabbed panels not centering
Hiya,
I am trying to put a different google map on each tab of a tabbed panel. The map on the default page works fine but the ones on other tabs appear only in the top left of the container div. From what I have read this is due to the hidden container divs having a size(0,0) so the google map centres in the top left and doesn't resize when the tab is activated.
I realise this is a known bug and a lot of people seem to have fixed it in version 2, but not version 3 google maps. Unfortunately none of the fixes seem to have worked for me. I think the code fixes might work but I'm sure sure where to insert them into the javascript?
I'm hoping someone could help me work out what code to put where to get the google maps on the hidden tabbed panels to either resize when the tab is activated, or be made permanetly the correct size?
Code below:
(header)
<script type="text/javascript">
function initDexGoogleMap(canvas, width, w_unit, height, h_unit, latitude, longitude, p_zoom, p_mapType, p_navControl, p_navStyle, p_navPosition, p_mapTypeC, p_mapTypeCStyle, p_mapTypeCPosition, p_scaleC, p_scaleCPosition, p_draggable, p_disableDoubleClickZoom, p_keyboardShortcuts, p_trafficL, p_bikeL, p_panoramio )
{document.write('<div id="'+canvas+'"></div>');
document.getElementById(canvas).style.width = width + w_unit; document.getElementById(canvas).style.height = height + h_unit;
var latlng = new google.maps.LatLng(latitude,longitude);
var myOptions = {zoom: p_zoom, center: latlng, navigationControl: p_navControl, navigationControlOptions: {style: p_navStyle, position: p_navPosition}, mapTypeControl: p_mapTypeC, mapTypeControlOptions: {style: p_mapTypeCStyle, position: p_mapTypeCPosition}, scaleControl: p_scaleC, scaleControlOptions:
{position: p_scaleCPosition}, mapTypeId: p_mapType, draggable: p_draggable, disableDoubleClickZoom: p_disableDoubleClickZoom, keyboardShortcuts: p_keyboardShortcuts};
var map = new google.maps.Map(document.getElementById(canvas), myOptions);
(Body)
<div id="DEX_GContainer0">
<script type="text/javascript">var my_DEX_GContainer0 = initDexGoogleMap
("DEX_GContainer0","450","px","450","px",51.5313695, -0.1031838,16,google.maps.MapTypeId.ROADMAP,true,google.maps.
NavigationControlStyle.DEFAULT,google.maps.ControlPosition.TOP_LEFT,true,google.maps.MapTypeControlStyle.DEFAULT,google.maps.ControlPosition.TOP_RIGHT,true,google.maps.ControlPosition.BOTTOM_LEFT,true,false,true,false,false,false); addMarker(my_DEX_GContainer0,51.5313695,-0.1031838,false,"Fitness%20First","","","click","");
</script>
</div>
Thanks!