The function that initializes the map will be executed on DOMReady
, but the function that sets the height will be executed onload
(what happens after DOMReady).
At the moment where you initialize the map the size of #map_canvas
isn's set yet.
Execute the function that initializes the map after setting the height.