Applied patch for #514 to fix map.getCurrentSize() in Safari.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2306 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -628,12 +628,12 @@ OpenLayers.Map.prototype = {
|
|||||||
this.div.clientHeight);
|
this.div.clientHeight);
|
||||||
|
|
||||||
// Workaround for the fact that hidden elements return 0 for size.
|
// 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);
|
var dim = OpenLayers.Element.getDimensions(this.div);
|
||||||
size.w = dim.width;
|
size.w = dim.width;
|
||||||
size.h = dim.height;
|
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.w = parseInt(this.div.style.width);
|
||||||
size.h = parseInt(this.div.style.height);
|
size.h = parseInt(this.div.style.height);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user