Hi All,
I'm facing a strange problem:
when I've the OLMap inside a VerticalLayout not in the position 0 if
I remove a Component that is above it the latter is correctly moved up
but it becomes like invisible.
You can reproduce the problem with a VL with inside a Button and the OLMap:
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final Button button = new Button("Remove me");
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
layout.removeComponent(button);
}
});
OLOSMSourceOptions opts = new OLOSMSourceOptions();
opts.setCustomAttributions(new String []{"custom attribution"});
opts.setShowAttributions(true);
opts.setMaxZoom(16);
OLOSMSource source = new OLOSMSource(opts);
OLViewOptions opts2 = new OLViewOptions();
opts2.setInputProjection(Projections.EPSG4326);
OLView view = new OLView(opts2);
view.setCenter(0, 0);
view.setZoom(3);
OLMap map = new OLMap();
map.addLayer(new OLTileLayer(source));
map.setView(view);
layout.addComponent(button);
layout.addComponent(map);
getPage().setTitle("Test");
setContent(layout);
setSizeFull();
}
It looks like the VerticalLayout calls some methods to move up the map
and something in these methods makes it like invisible.
This is the only workaround I found:
map.setVisible(false);
getUI().push();
map.setVisible(true);
getUI().push();
but it's not really elegant and it should be called before any refresh
from the UI thread or manual push.
I hope somebody has a better idea or at least, an explanation of why this is happening.
The Vaadin version I'm using is the 7.7.8.
Hi All,
I'm facing a strange problem:
when I've the OLMap inside a VerticalLayout not in the position 0 if
I remove a Component that is above it the latter is correctly moved up
but it becomes like invisible.
You can reproduce the problem with a VL with inside a Button and the OLMap:
It looks like the VerticalLayout calls some methods to move up the map
and something in these methods makes it like invisible.
This is the only workaround I found:
but it's not really elegant and it should be called before any refresh
from the UI thread or manual push.
I hope somebody has a better idea or at least, an explanation of why this is happening.
The Vaadin version I'm using is the 7.7.8.