In some use cases (ie. when the MapPanel is part of a layout), the rendering sequence seems to cause problems with map initialization, particularly dealing with extent.
When set as an item of a border layout for example, the MapPanel's onRender method is called to early (before the layout is done). This results in a map rendered first in an element with no dimensions.
The attached patch introduce a new initMap method called either when the element is rendered or after its parent's layout is done (if any). It also adds the layers only after the map is rendered to prevent Map.updateSize to be called twice.
State set to "Needs more work" since patch is missing tests.