-1

我想避免scroll-baropenlayers popup feature以下是我的代码

popup = new OpenLayers.Popup.FramedCloud("chicken", 
            event.feature.geometry.getBounds().getCenterLonLat(),
            new OpenLayers.Size(100,100),
            content,
            null, true, onPopupClose);

event.feature.popup = popup;
map.addPopup(popup);

地图div大小是250px x 250px,如果popup内容多于获取map divscroll-bar我们不能避免这种情况吗?

4

1 回答 1

1

您可以使用自定义样式覆盖 OpenLayers 样式,例如:

.olPopup {
  width: auto !important;
  height: auto !important;
}
.olPopupContent {
  width: auto !important;
  height: auto !important;
  max-width: 450px;
}

还可以查看可用的弹出类型,因为有些类型可能比其他类型更适合您的需求。

于 2013-05-15T13:13:59.443 回答