mstahv / v-leaflet

Leaflet add-on for Vaadin
Other
43 stars 38 forks source link

Add map with additional components to SubWindow #197

Closed alejandro7x closed 5 years ago

alejandro7x commented 5 years ago

Greetings,

I'm trying to visualize a map inside a VerticalLayout since I need to add a couple of additional controls to the SubWindow, when I add only the map (Without the layout) it works correctly but when I add the Layout with elements the map just disappears, what can I do?, I add the code I'm using.

Window window = new Window(); VerticalLayout vl = new VerticalLayout(); LMap map = getMap(latitude,longitude); map.setSizeFull(); vl.addComponent(new Label("MyNewLabel")); vl.addComponent(map); window.setContent(vl); window.setModal(true); window.setWidth("90%"); window.setHeight("90%"); Page.getCurrent().getUI().addWindow(window);

mstahv commented 5 years ago

Hi,

This is a generic Vaadin layout issue. The map is taking 100% height of 0 pixels. You can fix it by using:

vl.addComponentsAndExpand(map);

That makes the layout 100% height. You can probably also remove the map.setSizeFull() in this case as the helper method makes it 100% height too.

Sorry it too a while to investigate the issue. My time has been too limited for this project lately 😥

cheers, matti