- // determine actual render dimensions of the contents by putting its
- // contents into a fake contentDiv (for the CSS) and then measuring it
- var preparedHTML = "<div class='" + this.contentDisplayClass+ "'>" +
- this.contentDiv.innerHTML +
- "</div>";
-
- var containerElement = (this.map) ? this.map.layerContainerDiv
- : document.body;
- var realSize = OpenLayers.Util.getRenderedDimensions(
- preparedHTML, null, {
- displayClass: this.displayClass,
- containerElement: containerElement
+ var self = this;
+
+ window.setTimeout(function() { // timeout added by SYP
+
+ // determine actual render dimensions of the contents by putting its
+ // contents into a fake contentDiv (for the CSS) and then measuring it
+ var preparedHTML = "<div class='" + self.contentDisplayClass+ "'>" +
+ self.contentDiv.innerHTML +
+ "</div>";
+
+ var containerElement = (self.map) ? self.map.layerContainerDiv
+ : document.body;
+ var realSize = OpenLayers.Util.getRenderedDimensions(
+ preparedHTML, null, {
+ displayClass: self.displayClass,
+ containerElement: containerElement
+ }
+ );
+
+ /*
+ * XXX: next four lines are added by SYP!
+ */
+ if (self.contentDiv) {
+ realSize.w = Math.max (realSize.w, self.contentDiv.scrollWidth);
+ realSize.h = Math.max (realSize.h, self.contentDiv.scrollHeight);