I am using Google Maps API v3, being displayed on a jQuery UI Tab. I have been struggling with triggering my google map to resize correctly when the tab displaying the map
I managed to solve this by initialising the map when the map tab is shown and by also editing some css (the css is more than likely a theme related issue).
/* Initialise jQuery UI Tabs */
jQuery(function() {
jQuery( "#tabs" ).tabs({
fx: {
opacity: 'toggle',
duration: 300
}
});
});
/* Redraw the Google Map everytime tab-4 is shown/clicked */
jQuery(function() {
jQuery( "#tabs" ).bind( "tabsshow", function(event, ui) {
if (ui.panel.id == "tabs-4") {
var mapOptions = {
center: myLatlng,
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
}
});
});
And then add some CSS to fix the map controls if they are out of place etc.
#map img { max-width:none; }
if max-width of all images is set to 100% you will get problems.
Hope this helps!