As suggested in my comment, you're better off creating the map inside the dialog. Still needs refining regarding the size of the canvas (needs to factor in the scroll bars of the dialog), but you get the idea.
HTML:
<div id="dialog">
<div id="map-canvas"></div>
</div>
JS:
var map;
function initialize()
{
var mapOptions =
{
center: new google.maps.LatLng(40.729884, -73.990988),
zoom: 18,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false
};
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
}
$("#dialog").dialog(
{
resizable: true,
draggable: true,
show: { effect: 'drop', direction: "left" },
hide: 'slide', position: "right top", height: 300, width: 500,
resizeStop: function (event, ui)
{
$("#map-canvas").css({height:ui.size.height, width : ui.size.width});
google.maps.event.trigger(map, 'resize')
},
open: function (event, ui)
{
$("#map-canvas").css({height:300, width : 500});
initialize();
}
});