2014-01-12 26 views
1

我正在使用以下函數來設置彈出窗口的大小。但是,我注意到彈窗的大小總是超過了我設定的大小,而我有左邊的右邊距(見下文)。什麼是設置openlayers彈出窗口大小的正確方法?

我的代碼有問題嗎?

function onFeatureSelect(feature) { 

    selectedFeature = feature; 
    mydescription='<a href="' + feature.attributes.path + '">' + '<div class="visual">' + feature.attributes.image + '</div>' + '<div class="textual"><h2 class="title">' + feature.attributes.title + '</h2>' +'<div class="description">' + feature.attributes.description + '</div></div></a>'; 
    popup = new OpenLayers.Popup.FramedCloud("chicken", 
    feature.geometry.getBounds().getCenterLonLat(), 
    new OpenLayers.Size(500,300), mydescription , null, true, onPopupClose); 
    popup.autoSize = true; 
    popup.panMapIfOutOfView = false; 
    feature.popup = popup; 
    map.addPopup(popup); 
} 

screenshot

+0

很難說,我建議你調試使用Firebug的HTML。也許你有一個寬度設置在你的外部DIV或一些邊距上 – dube

回答

1

只需設置popup.autoSize = false;和彈出將是500像素x 300像素的

相關問題