I have searched the internet for a long time for a solution to this problem. There is either no easily found solution or I am terrible at researching. If it is the latter, I'm sorry. I've prepared the most basic jsfiddle possible to display my problem. You will see that the first map will load, and the second loads as well but is not usable. If someone can show me how to fix this so that both maps load normally, that would be great. thank you.
HTML:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Map 1</a>
</li>
<li><a href="#tabs-2">Map 2</a>
</li>
</ul>
<div id="tabs-1">
<div id="map-canvas"></div>
</div>
<div id="tabs-2">
<div id="map-canvas2"></div>
</div>
</div>
JAVASCRIPT:
$(document).ready(function () {
$("#tabs").tabs();
initialize();
});
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8
};
var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);
var map2 = new google.maps.Map(document.getElementById("map-canvas2"),
mapOptions);
}