diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index da3238ae27..2b824ef1b2 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -628,12 +628,12 @@ OpenLayers.Map.prototype = { this.div.clientHeight); // Workaround for the fact that hidden elements return 0 for size. - if (size.w == 0 && size.h == 0) { + if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) { var dim = OpenLayers.Element.getDimensions(this.div); size.w = dim.width; size.h = dim.height; } - if (size.w == 0 && size.h == 0) { + if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) { size.w = parseInt(this.div.style.width); size.h = parseInt(this.div.style.height); }