diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 1dd91f9267..6f1c0323f6 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -275,6 +275,10 @@ OpenLayers.Map.prototype = { this.size.w = dim.width; this.size.h = dim.height; } + if (this.size.w == 0 && this.size.h == 0) { + this.size.w = parseInt(this.div.style.width); + this.size.h = parseInt(this.div.style.height); + } }, /** * @return {OpenLayers.LonLat} diff --git a/tests/test_Layer_WMS.html b/tests/test_Layer_WMS.html index 94e590bcfc..d58e8a2ba0 100644 --- a/tests/test_Layer_WMS.html +++ b/tests/test_Layer_WMS.html @@ -64,6 +64,6 @@
- +