diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index ab2cc1a928..ed90015b61 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -588,8 +588,13 @@ OpenLayers.Map = OpenLayers.Class({ // Else updateSize on catching the window's resize // Note that this is ok, as updateSize() does nothing if the // map's size has not actually changed. - this.updateSizeDestroy = OpenLayers.Function.bind(this.updateSize, - this); + var me = this; + // We need to call this in the next cycle, otherwise it can cause + // issues on mobile devices on orientation change. It will use the + // height of the previous orientation otherwise. + this.updateSizeDestroy = function() { + window.setTimeout(function() { me.updateSize(); }, 0); + }; OpenLayers.Event.observe(window, 'resize', this.updateSizeDestroy); }