Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZoomToContent does not work when LMap is placed in VerticalSplitPanel #193

Open
TorstenBMR opened this issue Aug 30, 2018 · 0 comments
Open

Comments

@TorstenBMR
Copy link

this one is weird: I take a LMap, add 2 Markers, zoom it to its content. The map is zoomed correctly, if attached to any layout (e.g. VerticalLayout), but not, if attached to a VerticalSplitPanel - see screenshot (left is VerticalSplitPanel, right is VerticalLayout).

auswahl_001

This is the code:

{
HorizontalLayout hl = new MHorizontalLayout().withFullWidth().withFullHeight();
    {
      Label label = new MLabel("This one doesn't zoom");
      VerticalSplitPanel vsp1 = new VerticalSplitPanel(label, createMap());
      vsp1.setHeight("100%");
      hl.addComponent(vsp1);
    }
    {
      Label label = new MLabel("This one works fine");
      VerticalLayout vsp2 = new MVerticalLayout(label, createMap()).withFullHeight();
      hl.addComponent(vsp2);
    }
    Window w = new Window("Maps", hl);
    w.setWidth("1000px");
    w.setHeight("800px");
    w.center();
    UI.getCurrent().addWindow(w);
  }

 private Component createMap()
  {
    map = new LMap();
    map.addBaseLayer(new LOpenStreetMapLayer(), "OSM");
    map.addComponent(new LMarker(50d,10d));
    map.addComponent(new LMarker(50.1d,10.1d));
    map.setSizeFull();
    map.zoomToContent();  
    return map;
  }

``
I'm using Vaadin 7.7.14 and VLeaflet 1.06.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant