V-Leaflet Map in SubWindow and Resize Event

I am struggeling with some little problem using Vaadin 7 and the v-leaflet Addon.

I have a SubWindow where i place a LMap as content.

public class SubWindowSample extends Window
   public SubWindowSample( final String caption )
      super( caption );

      final LMap map = new LMap();
      map.setCenter( 50.06465, 19.94498 );

      final BaseLayer baselayer = new BaseLayer();
      baselayer.setName( "OpenStreetMap" );
      baselayer.setAttributionString( "OpenStreetMap" );
      baselayer.setUrl( "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" );
      map.setBaseLayers( baselayer );
      map.setImmediate( true );
      this.setHeight( "600px" );
      this.setWidth( "600px" );
      this.setContent( map );

When I zoom out and In, everything is fine. But when i resize the window to make it
, then the Tiles are not loaded so that the whole window is filled up. It simply stays grey. Even when i zoom out and in and move the map around.
When i make it
then the initial size, there is no problem.

Though the Map component seems to be resized ,because the label is always show in the lower right corner.
When i set the map to a fixed size (e.g. 1000x1000 pixels), then i can resize the window and zoom out/in without problems, as long as i stay below this map size.
But doing this, I get scrollbars on the Window, which i don’t want.

How can i force the map to reload the (missing) tiles or expand to the correct size automatically?

The attachment shows the problem on a screenshot.

I managed a workaround by reinitializing the map component after the resize event. But its probably not the way it should be done.


Looks like the underlaying leaflet library should be notified on each size change. Would you add an issue report to the projects github page:



There is now version 0.0.9 that should fix this issue. It also uses more recent leaflet under the hood, so there are some other small enhancements as well.