I think you might have to initialize it after showing the div, so it would end up looking something like this:
$(document).on('click', '#idOfElementTriggeringMap', function(){
$('#pano2').show();
ininitalizeMap('pano2');
}
});
function initializeMap(map){
// do map initialization here...
}
Update
I have since spotted this other post that suggests calling the resize event of the map after showing the div, which I presume would have the same effect: