改变容器Size后,刷新地图大小。
You need to call the API to update map size.
http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.updateSize
Here's how we do it
window.onresize = function()
{
setTimeout( function() { map.updateSize();}, 200);
}
You can see we did a slight delay, and honestly I don't remember the exact reason why, but we had to give it a slight wait before calling API to resize itself.