Search code examples
javascriptpopupopenlayers

OpenLayers FramedCloud Autosizing


According to the documentation, I should be able to configure the size of my OpenLayers popup by declaring an OpenLayers.Size object in the FramedCloud constructor:

this.popup = new OpenLayers.Popup.FramedCloud('featurePopup',
    this.options.feature.geometry.getBounds().getCenterLonLat(),
    new OpenLayers.Size(80, 60),
    html,
    null, true, this.onPopupClose
);
map.addPopup(this.popup, true);

Currently the popup that is rendered is autosized no matter what dimensions I use in the constructor.

enter image description here

I've tried manually setting the autosizing attribute of the FramedCloud to false as well as manually adjusting the css styling for the popup without achieving the results I need.

I checked and found some similar issues in the OpenLayers 2.11 issues list, but I haven't found a workaround. Any ideas?


Solution

  • Not sure how helpful this will be for others, but for this particular example, scrollbars were being rendered as a result of a floated div at the bottom of the dialog. By updating the css I was able to draw clean autosized popups without having to calculate custom dimensions.