From 9b9a902ec08042e3d889ed6caaf0940320e54a1c Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 21 Jun 2006 15:04:59 +0000 Subject: [PATCH] Add additional fallback for Map.js if getDimensions doesn't work. I think this is essentially a 'special case' for our testing process, but it fixes it for this case. git-svn-id: http://svn.openlayers.org/trunk/openlayers@652 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Map.js | 4 ++++ tests/test_Layer_WMS.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 @@ -
+